<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-- | Handy functions for creating much Core syntax</span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.Make</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-7"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing normal syntax</span></span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier">mkCoreLet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier">mkCoreLets</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApp"><span class="hs-identifier">mkCoreApp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-identifier">mkCoreApps</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier">mkCoreConApps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLams"><span class="hs-identifier">mkCoreLams</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkWildCase"><span class="hs-identifier">mkWildCase</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier">mkIfThenElse</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier">mkWildValBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkWildEvBinder"><span class="hs-identifier">mkWildEvBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><a href="GHC.Core.Utils.html#mkSingleAltCase"><span class="hs-identifier">mkSingleAltCase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#sortQuantVars"><span class="hs-identifier">sortQuantVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#castBottomExpr"><span class="hs-identifier">castBottomExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing boxed literals</span></span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkWordExpr"><span class="hs-identifier">mkWordExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkIntExpr"><span class="hs-identifier">mkIntExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkIntExprInt"><span class="hs-identifier">mkIntExprInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkUncheckedIntExpr"><span class="hs-identifier">mkUncheckedIntExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier">mkIntegerExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkNaturalExpr"><span class="hs-identifier">mkNaturalExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkFloatExpr"><span class="hs-identifier">mkFloatExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkDoubleExpr"><span class="hs-identifier">mkDoubleExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCharExpr"><span class="hs-identifier">mkCharExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkStringExpr"><span class="hs-identifier">mkStringExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier">mkStringExprFS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkStringExprFSWith"><span class="hs-identifier">mkStringExprFSWith</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Floats</span></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier">FloatBind</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier">wrapFloat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#wrapFloats"><span class="hs-identifier">wrapFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#floatBindings"><span class="hs-identifier">floatBindings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing small tuples</span></span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreVarTupTy"><span class="hs-identifier">mkCoreVarTupTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier">mkCoreTup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreUbxTup"><span class="hs-identifier">mkCoreUbxTup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreUbxSum"><span class="hs-identifier">mkCoreUbxSum</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTupBoxity"><span class="hs-identifier">mkCoreTupBoxity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#unitExpr"><span class="hs-identifier">unitExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing big tuples</span></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier">mkBigCoreVarTup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTup1"><span class="hs-identifier">mkBigCoreVarTup1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier">mkBigCoreVarTupTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier">mkBigCoreTupTy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier">mkBigCoreTup</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Deconstructing small tuples</span></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier">mkSmallTupleSelector</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier">mkSmallTupleCase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Deconstructing big tuples</span></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier">mkTupleSelector</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkTupleSelector1"><span class="hs-identifier">mkTupleSelector1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier">mkTupleCase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing list expressions</span></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier">mkNilExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier">mkConsExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkListExpr"><span class="hs-identifier">mkListExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkFoldrExpr"><span class="hs-identifier">mkFoldrExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkBuildExpr"><span class="hs-identifier">mkBuildExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing Maybe expressions</span></span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkNothingExpr"><span class="hs-identifier">mkNothingExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkJustExpr"><span class="hs-identifier">mkJustExpr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Error Ids</span></span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#mkRuntimeErrorApp"><span class="hs-identifier">mkRuntimeErrorApp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkImpossibleExpr"><span class="hs-identifier">mkImpossibleExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkAbsentErrorApp"><span class="hs-identifier">mkAbsentErrorApp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#errorIds"><span class="hs-identifier">errorIds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#rEC_CON_ERROR_ID"><span class="hs-identifier">rEC_CON_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier">rUNTIME_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#nO_METHOD_BINDING_ERROR_ID"><span class="hs-identifier">nO_METHOD_BINDING_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier">pAT_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rEC_SEL_ERROR_ID"><span class="hs-identifier">rEC_SEL_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier">aBSENT_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.Core.Make.html#tYPE_ERROR_ID"><span class="hs-identifier">tYPE_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier">EvVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#setTyVarUnique"><span class="hs-identifier">setTyVarUnique</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier">exprType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#needsCaseBinding"><span class="hs-identifier">needsCaseBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#mkSingleAltCase"><span class="hs-identifier">mkSingleAltCase</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier">bindNonRec</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html"><span class="hs-identifier">GHC.Hs.Utils</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html#mkChunkified"><span class="hs-identifier">mkChunkified</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html#chunkify"><span class="hs-identifier">chunkify</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#isCoVar"><span class="hs-identifier">isCoVar</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier">DataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConWorkId"><span class="hs-identifier">dataConWorkId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html"><span class="hs-identifier">GHC.Types.Demand</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Cpr.html"><span class="hs-identifier">GHC.Types.Cpr</span></a></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>      </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier">varName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier">ord</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">4</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApp"><span class="hs-operator hs-type">`mkCoreApp`</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-operator hs-type">`mkCoreApps`</span></a></span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Basic GHC.Core construction}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-99"></span><span class="annot"><a href="GHC.Core.Make.html#sortQuantVars"><span class="hs-identifier hs-type">sortQuantVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- Sort the variables, putting type and covars first, in scoped order,</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- and then other Ids</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- It is a deterministic sort, meaining it doesn't look at the values of</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- Uniques. For explanation why it's important See Note [Unique Determinism]</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- in GHC.Types.Unique.</span><span>
</span><span id="line-105"></span><span id="sortQuantVars"><span class="annot"><span class="annottext">sortQuantVars :: [Id] -&gt; [Id]
</span><a href="GHC.Core.Make.html#sortQuantVars"><span class="hs-identifier hs-var hs-var">sortQuantVars</span></a></span></span><span> </span><span id="local-6989586621680868731"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868731"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868730"><span class="hs-identifier hs-var">sorted_tcvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [Id]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868729"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-106"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680868726"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868726"><span class="hs-identifier hs-var">tcvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868729"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868729"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; ([Id], [Id])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; (Id -&gt; Bool) -&gt; Id -&gt; Bool
forall (f :: * -&gt; *). Applicative f =&gt; f Bool -&gt; f Bool -&gt; f Bool
</span><a href="GHC.Utils.Misc.html#%3C%7C%7C%3E"><span class="hs-operator hs-var">&lt;||&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isCoVar"><span class="hs-identifier hs-var">isCoVar</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868731"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621680868730"><span class="annot"><span class="annottext">sorted_tcvs :: [Id]
</span><a href="#local-6989586621680868730"><span class="hs-identifier hs-var hs-var">sorted_tcvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868726"><span class="hs-identifier hs-var">tcvs</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="hs-comment">-- | Bind a binding group over an expression, using a @let@ or @case@ as</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- appropriate (see &quot;GHC.Core#let_app_invariant&quot;)</span><span>
</span><span id="line-112"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-type">mkCoreLet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-113"></span><span id="mkCoreLet"><span class="annot"><span class="annottext">mkCoreLet :: CoreBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-var hs-var">mkCoreLet</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680868720"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868720"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680868719"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868719"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868718"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868718"><span class="hs-identifier hs-var">body</span></a></span></span><span>        </span><span class="hs-comment">-- See Note [Core let/app invariant]</span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier hs-var">bindNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868720"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868719"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868718"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-115"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-var">mkCoreLet</span></a></span><span> </span><span id="local-6989586621680868717"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868717"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span id="local-6989586621680868716"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868716"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-116"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868717"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868716"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">-- | Create a lambda where the given expression has a number of variables</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- bound over it. The leftmost binder is that bound by the outermost</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- lambda in the result</span><span>
</span><span id="line-121"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLams"><span class="hs-identifier hs-type">mkCoreLams</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBndr"><span class="hs-identifier hs-type">CoreBndr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-122"></span><span id="mkCoreLams"><span class="annot"><span class="annottext">mkCoreLams :: [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLams"><span class="hs-identifier hs-var hs-var">mkCoreLams</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- | Bind a list of binding groups over an expression. The leftmost binding</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- group becomes the outermost group in the resulting expression</span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-type">mkCoreLets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-127"></span><span id="mkCoreLets"><span class="annot"><span class="annottext">mkCoreLets :: [CoreBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var hs-var">mkCoreLets</span></a></span></span><span> </span><span id="local-6989586621680868712"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680868712"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621680868711"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868711"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreBind -&gt; CoreExpr -&gt; CoreExpr)
-&gt; CoreExpr -&gt; [CoreBind] -&gt; CoreExpr
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-var">mkCoreLet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868711"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680868712"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-comment">-- | Construct an expression which represents the application of a number of</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- expressions to that of a data constructor expression. The leftmost expression</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- in the list is applied first</span><span>
</span><span id="line-132"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-type">mkCoreConApps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-133"></span><span id="mkCoreConApps"><span class="annot"><span class="annottext">mkCoreConApps :: DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var hs-var">mkCoreConApps</span></a></span></span><span> </span><span id="local-6989586621680868709"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680868709"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680868708"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868708"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-identifier hs-var">mkCoreApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Id
</span><a href="GHC.Core.DataCon.html#dataConWorkId"><span class="hs-identifier hs-var">dataConWorkId</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680868709"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868708"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="hs-comment">-- | Construct an expression which represents the application of a number of</span><span>
</span><span id="line-136"></span><span class="hs-comment">-- expressions to another. The leftmost expression in the list is applied first</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- Respects the let/app invariant by building a case expression where necessary</span><span>
</span><span id="line-138"></span><span class="hs-comment">--   See Note [Core let/app invariant] in &quot;GHC.Core&quot;</span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-identifier hs-type">mkCoreApps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-140"></span><span id="mkCoreApps"><span class="annot"><span class="annottext">mkCoreApps :: CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-identifier hs-var hs-var">mkCoreApps</span></a></span></span><span> </span><span id="local-6989586621680868706"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868706"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680868705"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868705"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr, Type) -&gt; CoreExpr
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr, Type) -&gt; CoreExpr) -&gt; (CoreExpr, Type) -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-142"></span><span>    </span><span class="annot"><span class="annottext">((CoreExpr, Type) -&gt; CoreExpr -&gt; (CoreExpr, Type))
-&gt; (CoreExpr, Type) -&gt; [CoreExpr] -&gt; (CoreExpr, Type)
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; (CoreExpr, Type) -&gt; CoreExpr -&gt; (CoreExpr, Type)
</span><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-var">mkCoreAppTyped</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680868702"><span class="hs-identifier hs-var">doc_string</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868706"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868701"><span class="hs-identifier hs-var">fun_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868705"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-143"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-144"></span><span>    </span><span id="local-6989586621680868702"><span class="annot"><span class="annottext">doc_string :: SDoc
</span><a href="#local-6989586621680868702"><span class="hs-identifier hs-var hs-var">doc_string</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868701"><span class="hs-identifier hs-var">fun_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868706"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868705"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621680868701"><span class="annot"><span class="annottext">fun_ty :: Type
</span><a href="#local-6989586621680868701"><span class="hs-identifier hs-var hs-var">fun_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868706"><span class="hs-identifier hs-var">fun</span></a></span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-- | Construct an expression which represents the application of one expression</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- to the other</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- Respects the let/app invariant by building a case expression where necessary</span><span>
</span><span id="line-150"></span><span class="hs-comment">--   See Note [Core let/app invariant] in &quot;GHC.Core&quot;</span><span>
</span><span id="line-151"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreApp"><span class="hs-identifier hs-type">mkCoreApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-152"></span><span id="mkCoreApp"><span class="annot"><span class="annottext">mkCoreApp :: SDoc -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreApp"><span class="hs-identifier hs-var hs-var">mkCoreApp</span></a></span></span><span> </span><span id="local-6989586621680868692"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680868692"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621680868691"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868691"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680868690"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868690"><span class="hs-identifier hs-var">arg</span></a></span></span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr, Type) -&gt; CoreExpr
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr, Type) -&gt; CoreExpr) -&gt; (CoreExpr, Type) -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; (CoreExpr, Type) -&gt; CoreExpr -&gt; (CoreExpr, Type)
</span><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-var">mkCoreAppTyped</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680868692"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868691"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868691"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868690"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- | Construct an expression which represents the application of one expression</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- paired with its type to an argument. The result is paired with its type. This</span><span>
</span><span id="line-157"></span><span class="hs-comment">-- function is not exported and used in the definition of 'mkCoreApp' and</span><span>
</span><span id="line-158"></span><span class="hs-comment">-- 'mkCoreApps'.</span><span>
</span><span id="line-159"></span><span class="hs-comment">-- Respects the let/app invariant by building a case expression where necessary</span><span>
</span><span id="line-160"></span><span class="hs-comment">--   See Note [Core let/app invariant] in &quot;GHC.Core&quot;</span><span>
</span><span id="line-161"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-type">mkCoreAppTyped</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span id="mkCoreAppTyped"><span class="annot"><span class="annottext">mkCoreAppTyped :: SDoc -&gt; (CoreExpr, Type) -&gt; CoreExpr -&gt; (CoreExpr, Type)
</span><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-var hs-var">mkCoreAppTyped</span></a></span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868689"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868689"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868688"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868688"><span class="hs-identifier hs-var">fun_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621680868686"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868686"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868689"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868686"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type -&gt; Type
Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.Type.html#piResultTy"><span class="hs-identifier hs-var">piResultTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868688"><span class="hs-identifier hs-var">fun_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868686"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-var">mkCoreAppTyped</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868683"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868683"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868682"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868682"><span class="hs-identifier hs-var">fun_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621680868680"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680868680"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868683"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; CoreExpr
forall b. Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-var">Coercion</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680868680"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Core.Type.html#funResultTy"><span class="hs-identifier hs-var">funResultTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868682"><span class="hs-identifier hs-var">fun_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreAppTyped"><span class="hs-identifier hs-var">mkCoreAppTyped</span></a></span><span> </span><span id="local-6989586621680868678"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680868678"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868677"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868677"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868676"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868676"><span class="hs-identifier hs-var">fun_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868675"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868675"><span class="hs-identifier hs-var">arg</span></a></span></span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isFunTy</span><span> </span><span class="hs-identifier">fun_ty</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">fun</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">arg</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">d</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; Scaled Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkValApp"><span class="hs-identifier hs-var">mkValApp</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868677"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868675"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Scaled Type
forall a. Type -&gt; a -&gt; Scaled a
</span><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-var">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868667"><span class="hs-identifier hs-var">mult</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868666"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868665"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868665"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680868667"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868667"><span class="hs-identifier hs-var">mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868666"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868666"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868665"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868665"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type, Type)
</span><a href="GHC.Core.Type.html#splitFunTy"><span class="hs-identifier hs-var">splitFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868676"><span class="hs-identifier hs-var">fun_ty</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.Core.Make.html#mkValApp"><span class="hs-identifier hs-type">mkValApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-173"></span><span class="hs-comment">-- Build an application (e1 e2),</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- or a strict binding  (case e2 of x -&gt; e1 x)</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- using the latter when necessary to respect the let/app invariant</span><span>
</span><span id="line-176"></span><span class="hs-comment">--   See Note [Core let/app invariant] in GHC.Core</span><span>
</span><span id="line-177"></span><span id="mkValApp"><span class="annot"><span class="annottext">mkValApp :: CoreExpr -&gt; CoreExpr -&gt; Scaled Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkValApp"><span class="hs-identifier hs-var hs-var">mkValApp</span></a></span></span><span> </span><span id="local-6989586621680868663"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868663"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680868662"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868662"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621680868661"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868661"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680868660"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868660"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868659"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868659"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr -&gt; Bool
</span><a href="GHC.Core.Utils.html#needsCaseBinding"><span class="hs-identifier hs-var">needsCaseBinding</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868660"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868662"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868663"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868662"><span class="hs-identifier hs-var">arg</span></a></span><span>                </span><span class="hs-comment">-- The vastly common case</span><span>
</span><span id="line-180"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-181"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; Scaled Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkStrictApp"><span class="hs-identifier hs-var">mkStrictApp</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868663"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868662"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Scaled Type
forall a. Type -&gt; a -&gt; Scaled a
</span><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-var">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868661"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868660"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868659"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
              Building case expressions
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="annot"><a href="GHC.Core.Make.html#mkWildEvBinder"><span class="hs-identifier hs-type">mkWildEvBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span>
</span><span id="line-190"></span><span id="mkWildEvBinder"><span class="annot"><span class="annottext">mkWildEvBinder :: Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildEvBinder"><span class="hs-identifier hs-var hs-var">mkWildEvBinder</span></a></span></span><span> </span><span id="local-6989586621680868656"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868656"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868656"><span class="hs-identifier hs-var">pred</span></a></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="hs-comment">-- | Make a /wildcard binder/. This is typically used when you need a binder</span><span>
</span><span id="line-193"></span><span class="hs-comment">-- that you expect to use only at a *binding* site.  Do not use it at</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- occurrence sites because it has a single, fixed unique, and it's very</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- easy to get into difficulties with shadowing.  That's why it is used so little.</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- See Note [WildCard binders] in &quot;GHC.Core.Opt.Simplify.Env&quot;</span><span>
</span><span id="line-197"></span><span class="annot"><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-type">mkWildValBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Mult"><span class="hs-identifier hs-type">Mult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-198"></span><span id="mkWildValBinder"><span class="annot"><span class="annottext">mkWildValBinder :: Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var hs-var">mkWildValBinder</span></a></span></span><span> </span><span id="local-6989586621680868653"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868653"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680868652"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868652"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalIdOrCoVar"><span class="hs-identifier hs-var">mkLocalIdOrCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#wildCardName"><span class="hs-identifier hs-var">wildCardName</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868653"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868652"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-199"></span><span>  </span><span class="hs-comment">-- &quot;OrCoVar&quot; since a coercion can be a scrutinee with -fdefer-type-errors</span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-comment">-- (e.g. see test T15695). Ticket #17291 covers fixing this problem.</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span class="annot"><a href="GHC.Core.Make.html#mkWildCase"><span class="hs-identifier hs-type">mkWildCase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreAlt"><span class="hs-identifier hs-type">CoreAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-203"></span><span class="hs-comment">-- Make a case expression whose case binder is unused</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- The alts and res_ty should not have any occurrences of WildId</span><span>
</span><span id="line-205"></span><span id="mkWildCase"><span class="annot"><span class="annottext">mkWildCase :: CoreExpr -&gt; Scaled Type -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkWildCase"><span class="hs-identifier hs-var hs-var">mkWildCase</span></a></span></span><span> </span><span id="local-6989586621680868649"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868649"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621680868648"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868648"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680868647"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868647"><span class="hs-identifier hs-var">scrut_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868646"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868646"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621680868645"><span class="annot"><span class="annottext">[CoreAlt]
</span><a href="#local-6989586621680868645"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868649"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868648"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868647"><span class="hs-identifier hs-var">scrut_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868646"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreAlt]
</span><a href="#local-6989586621680868645"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="annot"><a href="GHC.Core.Make.html#mkStrictApp"><span class="hs-identifier hs-type">mkStrictApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-209"></span><span class="hs-comment">-- Build a strict application (case e2 of x -&gt; e1 x)</span><span>
</span><span id="line-210"></span><span id="mkStrictApp"><span class="annot"><span class="annottext">mkStrictApp :: CoreExpr -&gt; CoreExpr -&gt; Scaled Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkStrictApp"><span class="hs-identifier hs-var hs-var">mkStrictApp</span></a></span></span><span> </span><span id="local-6989586621680868643"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868643"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680868642"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868642"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621680868641"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868641"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680868640"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868640"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868639"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868639"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-211"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868642"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868638"><span class="hs-identifier hs-var">arg_id</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868639"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868643"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868638"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-212"></span><span>       </span><span class="hs-comment">-- mkDefaultCase looks attractive here, and would be sound.</span><span>
</span><span id="line-213"></span><span>       </span><span class="hs-comment">-- But it uses (exprType alt_rhs) to compute the result type,</span><span>
</span><span id="line-214"></span><span>       </span><span class="hs-comment">-- whereas here we already know that the result type is res_ty</span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-216"></span><span>    </span><span id="local-6989586621680868638"><span class="annot"><span class="annottext">arg_id :: Id
</span><a href="#local-6989586621680868638"><span class="hs-identifier hs-var hs-var">arg_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868641"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868640"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-217"></span><span>        </span><span class="hs-comment">-- Lots of shadowing, but it doesn't matter,</span><span>
</span><span id="line-218"></span><span>        </span><span class="hs-comment">-- because 'fun' and 'res_ty' should not have a free wild-id</span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-comment">-- This is Dangerous.  But this is the only place we play this</span><span>
</span><span id="line-221"></span><span>        </span><span class="hs-comment">-- game, mkStrictApp returns an expression that does not have</span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-comment">-- a free wild-id.  So the only way 'fun' could get a free wild-id</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-comment">-- would be if you take apart this case expression (or some other</span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-comment">-- expression that uses mkWildValBinder, of which there are not</span><span>
</span><span id="line-225"></span><span>        </span><span class="hs-comment">-- many), and pass a fragment of it as the fun part of a 'mkStrictApp'.</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span class="annot"><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier hs-type">mkIfThenElse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-228"></span><span id="mkIfThenElse"><span class="annot"><span class="annottext">mkIfThenElse :: CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier hs-var hs-var">mkIfThenElse</span></a></span></span><span> </span><span id="local-6989586621680868636"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868636"><span class="hs-identifier hs-var">guard</span></a></span></span><span> </span><span id="local-6989586621680868635"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868635"><span class="hs-identifier hs-var">then_expr</span></a></span></span><span> </span><span id="local-6989586621680868634"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868634"><span class="hs-identifier hs-var">else_expr</span></a></span></span><span>
</span><span id="line-229"></span><span class="hs-comment">-- Not going to be refining, so okay to take the type of the &quot;then&quot; clause</span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Scaled Type -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkWildCase"><span class="hs-identifier hs-var">mkWildCase</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868636"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Scaled Type
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#linear"><span class="hs-identifier hs-var">linear</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868635"><span class="hs-identifier hs-var">then_expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>         </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#falseDataCon"><span class="hs-identifier hs-var">falseDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868634"><span class="hs-identifier hs-var">else_expr</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- Increasing order of tag!</span><span>
</span><span id="line-232"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#trueDataCon"><span class="hs-identifier hs-var">trueDataCon</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868635"><span class="hs-identifier hs-var">then_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="annot"><a href="GHC.Core.Make.html#castBottomExpr"><span class="hs-identifier hs-type">castBottomExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- (castBottomExpr e ty), assuming that 'e' diverges,</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- return an expression of type 'ty'</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- See Note [Empty case alternatives] in GHC.Core</span><span>
</span><span id="line-238"></span><span id="castBottomExpr"><span class="annot"><span class="annottext">castBottomExpr :: CoreExpr -&gt; Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#castBottomExpr"><span class="hs-identifier hs-var hs-var">castBottomExpr</span></a></span></span><span> </span><span id="local-6989586621680868628"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868628"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680868627"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868627"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868626"><span class="hs-identifier hs-var">e_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868627"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868628"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868628"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#One"><span class="hs-identifier hs-var">One</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868626"><span class="hs-identifier hs-var">e_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868627"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-241"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-242"></span><span>    </span><span id="local-6989586621680868626"><span class="annot"><span class="annottext">e_ty :: Type
</span><a href="#local-6989586621680868626"><span class="hs-identifier hs-var hs-var">e_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868628"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Making literals}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Int@</span><span>
</span><span id="line-253"></span><span class="annot"><a href="GHC.Core.Make.html#mkIntExpr"><span class="hs-identifier hs-type">mkIntExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>        </span><span class="hs-comment">-- Result = I# i :: Int</span><span>
</span><span id="line-254"></span><span id="mkIntExpr"><span class="annot"><span class="annottext">mkIntExpr :: Platform -&gt; Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntExpr"><span class="hs-identifier hs-var hs-var">mkIntExpr</span></a></span></span><span> </span><span id="local-6989586621680868623"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868623"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621680868622"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868622"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#intDataCon"><span class="hs-identifier hs-var">intDataCon</span></a></span><span>  </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CoreExpr
forall b. Platform -&gt; Integer -&gt; Expr b
</span><a href="GHC.Core.html#mkIntLit"><span class="hs-identifier hs-var">mkIntLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868623"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868622"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Int@. Don't check</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- that the number is in the range of the target platform @Int@</span><span>
</span><span id="line-258"></span><span class="annot"><a href="GHC.Core.Make.html#mkUncheckedIntExpr"><span class="hs-identifier hs-type">mkUncheckedIntExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>        </span><span class="hs-comment">-- Result = I# i :: Int</span><span>
</span><span id="line-259"></span><span id="mkUncheckedIntExpr"><span class="annot"><span class="annottext">mkUncheckedIntExpr :: Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkUncheckedIntExpr"><span class="hs-identifier hs-var hs-var">mkUncheckedIntExpr</span></a></span></span><span> </span><span id="local-6989586621680868619"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868619"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#intDataCon"><span class="hs-identifier hs-var">intDataCon</span></a></span><span>  </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitIntUnchecked"><span class="hs-identifier hs-var">mkLitIntUnchecked</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868619"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Int@</span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.Core.Make.html#mkIntExprInt"><span class="hs-identifier hs-type">mkIntExprInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- Result = I# i :: Int</span><span>
</span><span id="line-263"></span><span id="mkIntExprInt"><span class="annot"><span class="annottext">mkIntExprInt :: Platform -&gt; Int -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntExprInt"><span class="hs-identifier hs-var hs-var">mkIntExprInt</span></a></span></span><span> </span><span id="local-6989586621680868616"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868616"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621680868615"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868615"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#intDataCon"><span class="hs-identifier hs-var">intDataCon</span></a></span><span>  </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CoreExpr
forall b. Platform -&gt; Integer -&gt; Expr b
</span><a href="GHC.Core.html#mkIntLit"><span class="hs-identifier hs-var">mkIntLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868616"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868615"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the a @Word@ with the given value</span><span>
</span><span id="line-266"></span><span class="annot"><a href="GHC.Core.Make.html#mkWordExpr"><span class="hs-identifier hs-type">mkWordExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-267"></span><span id="mkWordExpr"><span class="annot"><span class="annottext">mkWordExpr :: Platform -&gt; Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkWordExpr"><span class="hs-identifier hs-var hs-var">mkWordExpr</span></a></span></span><span> </span><span id="local-6989586621680868614"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868614"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621680868613"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868613"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#wordDataCon"><span class="hs-identifier hs-var">wordDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CoreExpr
forall b. Platform -&gt; Integer -&gt; Expr b
</span><a href="GHC.Core.html#mkWordLit"><span class="hs-identifier hs-var">mkWordLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680868614"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868613"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Integer@</span><span>
</span><span id="line-270"></span><span class="annot"><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier hs-type">mkIntegerExpr</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>  </span><span class="hs-comment">-- Result :: Integer</span><span>
</span><span id="line-271"></span><span id="mkIntegerExpr"><span class="annot"><span class="annottext">mkIntegerExpr :: Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier hs-var hs-var">mkIntegerExpr</span></a></span></span><span> </span><span id="local-6989586621680868610"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868610"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitInteger"><span class="hs-identifier hs-var">mkLitInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868610"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Natural@</span><span>
</span><span id="line-274"></span><span class="annot"><a href="GHC.Core.Make.html#mkNaturalExpr"><span class="hs-identifier hs-type">mkNaturalExpr</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-275"></span><span id="mkNaturalExpr"><span class="annot"><span class="annottext">mkNaturalExpr :: Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNaturalExpr"><span class="hs-identifier hs-var hs-var">mkNaturalExpr</span></a></span></span><span> </span><span id="local-6989586621680868608"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868608"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitNatural"><span class="hs-identifier hs-var">mkLitNatural</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680868608"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Float@</span><span>
</span><span id="line-278"></span><span class="annot"><a href="GHC.Core.Make.html#mkFloatExpr"><span class="hs-identifier hs-type">mkFloatExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Float</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-279"></span><span id="mkFloatExpr"><span class="annot"><span class="annottext">mkFloatExpr :: Float -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkFloatExpr"><span class="hs-identifier hs-var hs-var">mkFloatExpr</span></a></span></span><span> </span><span id="local-6989586621680868606"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621680868606"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#floatDataCon"><span class="hs-identifier hs-var">floatDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Float -&gt; CoreExpr
forall b. Float -&gt; Expr b
</span><a href="GHC.Core.html#mkFloatLitFloat"><span class="hs-identifier hs-var">mkFloatLitFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621680868606"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Double@</span><span>
</span><span id="line-282"></span><span class="annot"><a href="GHC.Core.Make.html#mkDoubleExpr"><span class="hs-identifier hs-type">mkDoubleExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Double</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-283"></span><span id="mkDoubleExpr"><span class="annot"><span class="annottext">mkDoubleExpr :: Double -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkDoubleExpr"><span class="hs-identifier hs-var hs-var">mkDoubleExpr</span></a></span></span><span> </span><span id="local-6989586621680868603"><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621680868603"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#doubleDataCon"><span class="hs-identifier hs-var">doubleDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Double -&gt; CoreExpr
forall b. Double -&gt; Expr b
</span><a href="GHC.Core.html#mkDoubleLitDouble"><span class="hs-identifier hs-var">mkDoubleLitDouble</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621680868603"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @Char@</span><span>
</span><span id="line-287"></span><span class="annot"><a href="GHC.Core.Make.html#mkCharExpr"><span class="hs-identifier hs-type">mkCharExpr</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>      </span><span class="hs-comment">-- Result = C# c :: Int</span><span>
</span><span id="line-288"></span><span id="mkCharExpr"><span class="annot"><span class="annottext">mkCharExpr :: Char -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCharExpr"><span class="hs-identifier hs-var hs-var">mkCharExpr</span></a></span></span><span> </span><span id="local-6989586621680868600"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680868600"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#charDataCon"><span class="hs-identifier hs-var">charDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char -&gt; CoreExpr
forall b. Char -&gt; Expr b
</span><a href="GHC.Core.html#mkCharLit"><span class="hs-identifier hs-var">mkCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680868600"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to the given @String@</span><span>
</span><span id="line-291"></span><span id="local-6989586621680868903"><span class="annot"><a href="GHC.Core.Make.html#mkStringExpr"><span class="hs-identifier hs-type">mkStringExpr</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#MonadThings"><span class="hs-identifier hs-type">MonadThings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868903"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868903"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span></span><span>  </span><span class="hs-comment">-- Result :: String</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-comment">-- | Create a 'CoreExpr' which will evaluate to a string morally equivalent to the given @FastString@</span><span>
</span><span id="line-294"></span><span id="local-6989586621680868899"><span class="annot"><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier hs-type">mkStringExprFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#MonadThings"><span class="hs-identifier hs-type">MonadThings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span></span><span>  </span><span class="hs-comment">-- Result :: String</span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span id="mkStringExpr"><span class="annot"><span class="annottext">mkStringExpr :: forall (m :: * -&gt; *). MonadThings m =&gt; String -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExpr"><span class="hs-identifier hs-var hs-var">mkStringExpr</span></a></span></span><span> </span><span id="local-6989586621680868595"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868595"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; m CoreExpr
forall (m :: * -&gt; *). MonadThings m =&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier hs-var">mkStringExprFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868595"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span id="mkStringExprFS"><span class="annot"><span class="annottext">mkStringExprFS :: forall (m :: * -&gt; *). MonadThings m =&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier hs-var hs-var">mkStringExprFS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; m Id) -&gt; FastString -&gt; m CoreExpr
forall (m :: * -&gt; *).
Monad m =&gt;
(Name -&gt; m Id) -&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFSWith"><span class="hs-identifier hs-var">mkStringExprFSWith</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; m Id
forall (m :: * -&gt; *). MonadThings m =&gt; Name -&gt; m Id
</span><a href="GHC.Driver.Types.html#lookupId"><span class="hs-identifier hs-var">lookupId</span></a></span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span id="local-6989586621680868896"><span class="annot"><a href="GHC.Core.Make.html#mkStringExprFSWith"><span class="hs-identifier hs-type">mkStringExprFSWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868896"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868896"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868896"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span></span><span>
</span><span id="line-301"></span><span id="mkStringExprFSWith"><span class="annot"><span class="annottext">mkStringExprFSWith :: forall (m :: * -&gt; *).
Monad m =&gt;
(Name -&gt; m Id) -&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFSWith"><span class="hs-identifier hs-var hs-var">mkStringExprFSWith</span></a></span></span><span> </span><span id="local-6989586621680868580"><span class="annot"><span class="annottext">Name -&gt; m Id
</span><a href="#local-6989586621680868580"><span class="hs-identifier hs-var">lookupM</span></a></span></span><span> </span><span id="local-6989586621680868579"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680868579"><span class="hs-identifier hs-var">str</span></a></span></span><span>
</span><span id="line-302"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Bool
</span><a href="GHC.Data.FastString.html#nullFS"><span class="hs-identifier hs-var">nullFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680868579"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; m CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var">mkNilExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#charTy"><span class="hs-identifier hs-var">charTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621680868575"><span class="hs-identifier hs-var">safeChar</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868574"><span class="hs-identifier hs-var">chars</span></a></span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680868573"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868573"><span class="hs-identifier hs-var">unpack_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; m Id
</span><a href="#local-6989586621680868580"><span class="hs-identifier hs-var">lookupM</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unpackCStringName"><span class="hs-identifier hs-var">unpackCStringName</span></a></span><span>
</span><span id="line-307"></span><span>       </span><span class="annot"><span class="annottext">CoreExpr -&gt; m CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868573"><span class="hs-identifier hs-var">unpack_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
forall {b}. Expr b
</span><a href="#local-6989586621680868571"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680868570"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868570"><span class="hs-identifier hs-var">unpack_utf8_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; m Id
</span><a href="#local-6989586621680868580"><span class="hs-identifier hs-var">lookupM</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unpackCStringUtf8Name"><span class="hs-identifier hs-var">unpackCStringUtf8Name</span></a></span><span>
</span><span id="line-311"></span><span>       </span><span class="annot"><span class="annottext">CoreExpr -&gt; m CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868570"><span class="hs-identifier hs-var">unpack_utf8_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
forall {b}. Expr b
</span><a href="#local-6989586621680868571"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-314"></span><span>    </span><span id="local-6989586621680868574"><span class="annot"><span class="annottext">chars :: String
</span><a href="#local-6989586621680868574"><span class="hs-identifier hs-var hs-var">chars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680868579"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-315"></span><span>    </span><span id="local-6989586621680868575"><span class="annot"><span class="annottext">safeChar :: Char -&gt; Bool
</span><a href="#local-6989586621680868575"><span class="hs-identifier hs-var hs-var">safeChar</span></a></span></span><span> </span><span id="local-6989586621680868562"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680868562"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680868562"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680868562"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x7F</span></span><span>
</span><span id="line-316"></span><span>    </span><span id="local-6989586621680868571"><span class="annot"><span class="annottext">lit :: Expr b
</span><a href="#local-6989586621680868571"><span class="hs-identifier hs-var hs-var">lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Expr b
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-var">LitString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680868579"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Tuple constructors}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="hs-comment">{-
Creating tuples and their types for Core expressions

@mkBigCoreVarTup@ builds a tuple; the inverse to @mkTupleSelector@.

* If it has only one element, it is the identity function.

* If there are more elements than a big tuple can have, it nests
  the tuples.

Note [Flattening one-tuples]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This family of functions creates a tuple of variables/expressions/types.
  mkCoreTup [e1,e2,e3] = (e1,e2,e3)
What if there is just one variable/expression/type in the argument?
We could do one of two things:

* Flatten it out, so that
    mkCoreTup [e1] = e1

* Build a one-tuple (see Note [One-tuples] in GHC.Builtin.Types)
    mkCoreTup1 [e1] = Solo e1
  We use a suffix &quot;1&quot; to indicate this.

Usually we want the former, but occasionally the latter.

NB: The logic in tupleDataCon knows about () and Solo and (,), etc.

Note [Don't flatten tuples from HsSyn]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we get an explicit 1-tuple from HsSyn somehow (likely: Template Haskell),
we should treat it really as a 1-tuple, without flattening. Note that a
1-tuple and a flattened value have different performance and laziness
characteristics, so should just do what we're asked.

This arose from discussions in #16881.

One-tuples that arise internally depend on the circumstance; often flattening
is a good idea. Decisions are made on a case-by-case basis.

-}</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span class="hs-comment">-- | Build the type of a small tuple that holds the specified variables</span><span>
</span><span id="line-369"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-370"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreVarTupTy"><span class="hs-identifier hs-type">mkCoreVarTupTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-371"></span><span id="mkCoreVarTupTy"><span class="annot"><span class="annottext">mkCoreVarTupTy :: [Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkCoreVarTupTy"><span class="hs-identifier hs-var hs-var">mkCoreVarTupTy</span></a></span></span><span> </span><span id="local-6989586621680868558"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868558"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868558"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="hs-comment">-- | Build a small tuple holding the specified expressions</span><span>
</span><span id="line-374"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-375"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-type">mkCoreTup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-376"></span><span id="mkCoreTup"><span class="annot"><span class="annottext">mkCoreTup :: [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-var hs-var">mkCoreTup</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868555"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868555"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868555"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-377"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-var">mkCoreTup</span></a></span><span> </span><span id="local-6989586621680868554"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868554"><span class="hs-identifier hs-var">cs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup1"><span class="hs-identifier hs-var">mkCoreTup1</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868554"><span class="hs-identifier hs-var">cs</span></a></span><span>   </span><span class="hs-comment">-- non-1-tuples are uniform</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="hs-comment">-- | Build a small tuple holding the specified expressions</span><span>
</span><span id="line-380"></span><span class="hs-comment">-- One-tuples are *not* flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-381"></span><span class="hs-comment">-- See also Note [Don't flatten tuples from HsSyn]</span><span>
</span><span id="line-382"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTup1"><span class="hs-identifier hs-type">mkCoreTup1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-383"></span><span id="mkCoreTup1"><span class="annot"><span class="annottext">mkCoreTup1 :: [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup1"><span class="hs-identifier hs-var hs-var">mkCoreTup1</span></a></span></span><span> </span><span id="local-6989586621680868552"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868552"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreExpr] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868552"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-384"></span><span>                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; (CoreExpr -&gt; Type) -&gt; CoreExpr -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868552"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868552"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-comment">-- | Build a small unboxed tuple holding the specified expressions,</span><span>
</span><span id="line-387"></span><span class="hs-comment">-- with the given types. The types must be the types of the expressions.</span><span>
</span><span id="line-388"></span><span class="hs-comment">-- Do not include the RuntimeRep specifiers; this function calculates them</span><span>
</span><span id="line-389"></span><span class="hs-comment">-- for you.</span><span>
</span><span id="line-390"></span><span class="hs-comment">-- Does /not/ flatten one-tuples; see Note [Flattening one-tuples]</span><span>
</span><span id="line-391"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreUbxTup"><span class="hs-identifier hs-type">mkCoreUbxTup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-392"></span><span id="mkCoreUbxTup"><span class="annot"><span class="annottext">mkCoreUbxTup :: [Type] -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreUbxTup"><span class="hs-identifier hs-var hs-var">mkCoreUbxTup</span></a></span></span><span> </span><span id="local-6989586621680868547"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868547"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621680868546"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868546"><span class="hs-identifier hs-var">exps</span></a></span></span><span>
</span><span id="line-393"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">tys</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">equalLength</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">exps</span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span>    </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868547"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; [Type] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; (Type -&gt; Type) -&gt; Type -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868547"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; [Type] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868547"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868546"><span class="hs-identifier hs-var">exps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-396"></span><span>
</span><span id="line-397"></span><span class="hs-comment">-- | Make a core tuple of the given boxity; don't flatten 1-tuples</span><span>
</span><span id="line-398"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTupBoxity"><span class="hs-identifier hs-type">mkCoreTupBoxity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Boxity"><span class="hs-identifier hs-type">Boxity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-399"></span><span id="mkCoreTupBoxity"><span class="annot"><span class="annottext">mkCoreTupBoxity :: Boxity -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTupBoxity"><span class="hs-identifier hs-var hs-var">mkCoreTupBoxity</span></a></span></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span>   </span><span id="local-6989586621680868541"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868541"><span class="hs-identifier hs-var">exps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup1"><span class="hs-identifier hs-var">mkCoreTup1</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868541"><span class="hs-identifier hs-var">exps</span></a></span><span>
</span><span id="line-400"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreTupBoxity"><span class="hs-identifier hs-var">mkCoreTupBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span id="local-6989586621680868540"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868540"><span class="hs-identifier hs-var">exps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreUbxTup"><span class="hs-identifier hs-var">mkCoreUbxTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreExpr -&gt; Type) -&gt; [CoreExpr] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868540"><span class="hs-identifier hs-var">exps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868540"><span class="hs-identifier hs-var">exps</span></a></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="hs-comment">-- | Build an unboxed sum.</span><span>
</span><span id="line-403"></span><span class="hs-comment">--</span><span>
</span><span id="line-404"></span><span class="hs-comment">-- Alternative number (&quot;alt&quot;) starts from 1.</span><span>
</span><span id="line-405"></span><span class="annot"><a href="GHC.Core.Make.html#mkCoreUbxSum"><span class="hs-identifier hs-type">mkCoreUbxSum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-406"></span><span id="mkCoreUbxSum"><span class="annot"><span class="annottext">mkCoreUbxSum :: Int -&gt; Int -&gt; [Type] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreUbxSum"><span class="hs-identifier hs-var hs-var">mkCoreUbxSum</span></a></span></span><span> </span><span id="local-6989586621680868539"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868539"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621680868538"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868538"><span class="hs-identifier hs-var">alt</span></a></span></span><span> </span><span id="local-6989586621680868537"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868537"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621680868536"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868536"><span class="hs-identifier hs-var">exp</span></a></span></span><span>
</span><span id="line-407"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">length</span><span> </span><span class="hs-identifier">tys</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">arity</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>    </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">alt</span><span> </span><span class="hs-operator">&lt;=</span><span> </span><span class="hs-identifier">arity</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>    </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#sumDataCon"><span class="hs-identifier hs-var">sumDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868538"><span class="hs-identifier hs-var">alt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680868539"><span class="hs-identifier hs-var">arity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-410"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; [Type] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; (Type -&gt; Type) -&gt; Type -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868537"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-411"></span><span>                   </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; CoreExpr) -&gt; [Type] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868537"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-412"></span><span>                   </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868536"><span class="hs-identifier hs-var">exp</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span class="hs-comment">-- | Build a big tuple holding the specified variables</span><span>
</span><span id="line-415"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-416"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-type">mkBigCoreVarTup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-417"></span><span id="mkBigCoreVarTup"><span class="annot"><span class="annottext">mkBigCoreVarTup :: [Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var hs-var">mkBigCoreVarTup</span></a></span></span><span> </span><span id="local-6989586621680868534"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868534"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868534"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTup1"><span class="hs-identifier hs-type">mkBigCoreVarTup1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-420"></span><span class="hs-comment">-- Same as mkBigCoreVarTup, but one-tuples are NOT flattened</span><span>
</span><span id="line-421"></span><span class="hs-comment">--                          see Note [Flattening one-tuples]</span><span>
</span><span id="line-422"></span><span id="mkBigCoreVarTup1"><span class="annot"><span class="annottext">mkBigCoreVarTup1 :: [Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup1"><span class="hs-identifier hs-var hs-var">mkBigCoreVarTup1</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868533"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868533"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-423"></span><span>                                      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868533"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868533"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-424"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTup1"><span class="hs-identifier hs-var">mkBigCoreVarTup1</span></a></span><span> </span><span id="local-6989586621680868532"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868532"><span class="hs-identifier hs-var">ids</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868532"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-425"></span><span>
</span><span id="line-426"></span><span class="hs-comment">-- | Build the type of a big tuple that holds the specified variables</span><span>
</span><span id="line-427"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-428"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-type">mkBigCoreVarTupTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-429"></span><span id="mkBigCoreVarTupTy"><span class="annot"><span class="annottext">mkBigCoreVarTupTy :: [Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var hs-var">mkBigCoreVarTupTy</span></a></span></span><span> </span><span id="local-6989586621680868531"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868531"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868531"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="hs-comment">-- | Build a big tuple holding the specified expressions</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-433"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-type">mkBigCoreTup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-434"></span><span id="mkBigCoreTup"><span class="annot"><span class="annottext">mkBigCoreTup :: [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var hs-var">mkBigCoreTup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([CoreExpr] -&gt; CoreExpr) -&gt; [CoreExpr] -&gt; CoreExpr
forall a. ([a] -&gt; a) -&gt; [a] -&gt; a
</span><a href="GHC.Hs.Utils.html#mkChunkified"><span class="hs-identifier hs-var">mkChunkified</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-var">mkCoreTup</span></a></span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span class="hs-comment">-- | Build the type of a big tuple that holds the specified type of thing</span><span>
</span><span id="line-437"></span><span class="hs-comment">-- One-tuples are flattened; see Note [Flattening one-tuples]</span><span>
</span><span id="line-438"></span><span class="annot"><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-type">mkBigCoreTupTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-439"></span><span id="mkBigCoreTupTy"><span class="annot"><span class="annottext">mkBigCoreTupTy :: [Type] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var hs-var">mkBigCoreTupTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Type] -&gt; Type) -&gt; [Type] -&gt; Type
forall a. ([a] -&gt; a) -&gt; [a] -&gt; a
</span><a href="GHC.Hs.Utils.html#mkChunkified"><span class="hs-identifier hs-var">mkChunkified</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span class="hs-comment">-- | The unit expression</span><span>
</span><span id="line-442"></span><span class="annot"><a href="GHC.Core.Make.html#unitExpr"><span class="hs-identifier hs-type">unitExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-443"></span><span id="unitExpr"><span class="annot"><span class="annottext">unitExpr :: CoreExpr
</span><a href="GHC.Core.Make.html#unitExpr"><span class="hs-identifier hs-var hs-var">unitExpr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.html#unitDataConId"><span class="hs-identifier hs-var">unitDataConId</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Tuple destructors}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- | Builds a selector which scrutises the given</span><span>
</span><span id="line-454"></span><span class="hs-comment">-- expression and extracts the one name from the list given.</span><span>
</span><span id="line-455"></span><span class="hs-comment">-- If you want the no-shadowing rule to apply, the caller</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- is responsible for making sure that none of these names</span><span>
</span><span id="line-457"></span><span class="hs-comment">-- are in scope.</span><span>
</span><span id="line-458"></span><span class="hs-comment">--</span><span>
</span><span id="line-459"></span><span class="hs-comment">-- If there is just one 'Id' in the tuple, then the selector is</span><span>
</span><span id="line-460"></span><span class="hs-comment">-- just the identity.</span><span>
</span><span id="line-461"></span><span class="hs-comment">--</span><span>
</span><span id="line-462"></span><span class="hs-comment">-- If necessary, we pattern match on a \&quot;big\&quot; tuple.</span><span>
</span><span id="line-463"></span><span class="hs-comment">--</span><span>
</span><span id="line-464"></span><span class="hs-comment">-- A tuple selector is not linear in its argument. Consequently, the case</span><span>
</span><span id="line-465"></span><span class="hs-comment">-- expression built by `mkTupleSelector` must consume its scrutinee 'Many'</span><span>
</span><span id="line-466"></span><span class="hs-comment">-- times. And all the argument variables must have multiplicity 'Many'.</span><span>
</span><span id="line-467"></span><span class="annot"><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-type">mkTupleSelector</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkTupleSelector1"><span class="hs-identifier hs-type">mkTupleSelector1</span></a></span><span>
</span><span id="line-468"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- ^ The 'Id's to pattern match the tuple against</span><span>
</span><span id="line-469"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>           </span><span class="hs-comment">-- ^ The 'Id' to select</span><span>
</span><span id="line-470"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>           </span><span class="hs-comment">-- ^ A variable of the same type as the scrutinee</span><span>
</span><span id="line-471"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- ^ Scrutinee</span><span>
</span><span id="line-472"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- ^ Selector expression</span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="hs-comment">-- mkTupleSelector [a,b,c,d] b v e</span><span>
</span><span id="line-475"></span><span class="hs-comment">--          = case e of v {</span><span>
</span><span id="line-476"></span><span class="hs-comment">--                (p,q) -&gt; case p of p {</span><span>
</span><span id="line-477"></span><span class="hs-comment">--                           (a,b) -&gt; b }}</span><span>
</span><span id="line-478"></span><span class="hs-comment">-- We use 'tpl' vars for the p,q, since shadowing does not matter.</span><span>
</span><span id="line-479"></span><span class="hs-comment">--</span><span>
</span><span id="line-480"></span><span class="hs-comment">-- In fact, it's more convenient to generate it innermost first, getting</span><span>
</span><span id="line-481"></span><span class="hs-comment">--</span><span>
</span><span id="line-482"></span><span class="hs-comment">--        case (case e of v</span><span>
</span><span id="line-483"></span><span class="hs-comment">--                (p,q) -&gt; p) of p</span><span>
</span><span id="line-484"></span><span class="hs-comment">--          (a,b) -&gt; b</span><span>
</span><span id="line-485"></span><span id="mkTupleSelector"><span class="annot"><span class="annottext">mkTupleSelector :: [Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-var hs-var">mkTupleSelector</span></a></span></span><span> </span><span id="local-6989586621680868529"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868529"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868528"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868528"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span id="local-6989586621680868527"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868527"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868526"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868526"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[Id]] -&gt; Id -&gt; CoreExpr
</span><a href="#local-6989586621680868525"><span class="hs-identifier hs-var">mk_tup_sel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [[Id]]
forall a. [a] -&gt; [[a]]
</span><a href="GHC.Hs.Utils.html#chunkify"><span class="hs-identifier hs-var">chunkify</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868529"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868528"><span class="hs-identifier hs-var">the_var</span></a></span><span>
</span><span id="line-487"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-488"></span><span>    </span><span id="local-6989586621680868525"><span class="annot"><span class="annottext">mk_tup_sel :: [[Id]] -&gt; Id -&gt; CoreExpr
</span><a href="#local-6989586621680868525"><span class="hs-identifier hs-var hs-var">mk_tup_sel</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868524"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868524"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621680868523"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868523"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier hs-var">mkSmallTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868524"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868523"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868527"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868526"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-489"></span><span>    </span><span class="annot"><a href="#local-6989586621680868525"><span class="hs-identifier hs-var">mk_tup_sel</span></a></span><span> </span><span id="local-6989586621680868522"><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621680868522"><span class="hs-identifier hs-var">vars_s</span></a></span></span><span> </span><span id="local-6989586621680868521"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868521"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier hs-var">mkSmallTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868520"><span class="hs-identifier hs-var">group</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868521"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868519"><span class="hs-identifier hs-var">tpl_v</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-490"></span><span>                                </span><span class="annot"><span class="annottext">[[Id]] -&gt; Id -&gt; CoreExpr
</span><a href="#local-6989586621680868525"><span class="hs-identifier hs-var">mk_tup_sel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [[Id]]
forall a. [a] -&gt; [[a]]
</span><a href="GHC.Hs.Utils.html#chunkify"><span class="hs-identifier hs-var">chunkify</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868518"><span class="hs-identifier hs-var">tpl_vs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868519"><span class="hs-identifier hs-var">tpl_v</span></a></span><span>
</span><span id="line-491"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-492"></span><span>          </span><span id="local-6989586621680868517"><span class="annot"><span class="annottext">tpl_tys :: [Type]
</span><a href="#local-6989586621680868517"><span class="hs-identifier hs-var hs-var">tpl_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868516"><span class="hs-identifier hs-var">gp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621680868516"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868516"><span class="hs-identifier hs-var">gp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621680868522"><span class="hs-identifier hs-var">vars_s</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-493"></span><span>          </span><span id="local-6989586621680868518"><span class="annot"><span class="annottext">tpl_vs :: [Id]
</span><a href="#local-6989586621680868518"><span class="hs-identifier hs-var hs-var">tpl_vs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [Id]
</span><a href="GHC.Types.Id.html#mkTemplateLocals"><span class="hs-identifier hs-var">mkTemplateLocals</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680868517"><span class="hs-identifier hs-var">tpl_tys</span></a></span><span>
</span><span id="line-494"></span><span>          </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621680868519"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868519"><span class="hs-identifier hs-var">tpl_v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868520"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868520"><span class="hs-identifier hs-var">group</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868512"><span class="hs-identifier hs-var">tpl</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868511"><span class="hs-identifier hs-var">gp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868512"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868512"><span class="hs-identifier hs-var">tpl</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680868511"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868511"><span class="hs-identifier hs-var">gp</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Id] -&gt; [[Id]] -&gt; [(Id, [Id])]
forall a b. String -&gt; [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="GHC.Utils.Misc.html#zipEqual"><span class="hs-identifier hs-var">zipEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkTupleSelector&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868518"><span class="hs-identifier hs-var">tpl_vs</span></a></span><span> </span><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621680868522"><span class="hs-identifier hs-var">vars_s</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-495"></span><span>                                         </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868521"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868511"><span class="hs-identifier hs-var">gp</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-496"></span><span class="hs-comment">-- ^ 'mkTupleSelector1' is like 'mkTupleSelector'</span><span>
</span><span id="line-497"></span><span class="hs-comment">-- but one-tuples are NOT flattened (see Note [Flattening one-tuples])</span><span>
</span><span id="line-498"></span><span id="mkTupleSelector1"><span class="annot"><span class="annottext">mkTupleSelector1 :: [Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector1"><span class="hs-identifier hs-var hs-var">mkTupleSelector1</span></a></span></span><span> </span><span id="local-6989586621680868508"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868508"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868507"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868507"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span id="local-6989586621680868506"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868506"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868505"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868505"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-499"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868508"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-500"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector1"><span class="hs-identifier hs-var">mkSmallTupleSelector1</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868508"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868507"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868506"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868505"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-501"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-502"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-var">mkTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868508"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868507"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868506"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868505"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-comment">-- | Like 'mkTupleSelector' but for tuples that are guaranteed</span><span>
</span><span id="line-505"></span><span class="hs-comment">-- never to be \&quot;big\&quot;.</span><span>
</span><span id="line-506"></span><span class="hs-comment">--</span><span>
</span><span id="line-507"></span><span class="hs-comment">-- &gt; mkSmallTupleSelector [x] x v e = [| e |]</span><span>
</span><span id="line-508"></span><span class="hs-comment">-- &gt; mkSmallTupleSelector [x,y,z] x v e = [| case e of v { (x,y,z) -&gt; x } |]</span><span>
</span><span id="line-509"></span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier hs-type">mkSmallTupleSelector</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleSelector1"><span class="hs-identifier hs-type">mkSmallTupleSelector1</span></a></span><span>
</span><span id="line-510"></span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- The tuple args</span><span>
</span><span id="line-511"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>          </span><span class="hs-comment">-- The selected one</span><span>
</span><span id="line-512"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>          </span><span class="hs-comment">-- A variable of the same type as the scrutinee</span><span>
</span><span id="line-513"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- Scrutinee</span><span>
</span><span id="line-514"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-515"></span><span id="mkSmallTupleSelector"><span class="annot"><span class="annottext">mkSmallTupleSelector :: [Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier hs-var hs-var">mkSmallTupleSelector</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868503"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868503"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621680868502"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868502"><span class="hs-identifier hs-var">should_be_the_same_var</span></a></span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680868501"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868501"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-516"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">var</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">should_be_the_same_var</span><span class="hs-special">)</span><span>
</span><span id="line-517"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868501"><span class="hs-identifier hs-var">scrut</span></a></span><span>  </span><span class="hs-comment">-- Special case for 1-tuples</span><span>
</span><span id="line-518"></span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleSelector"><span class="hs-identifier hs-var">mkSmallTupleSelector</span></a></span><span> </span><span id="local-6989586621680868500"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868500"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868499"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868499"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span id="local-6989586621680868498"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868498"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868497"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868497"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-519"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector1"><span class="hs-identifier hs-var">mkSmallTupleSelector1</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868500"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868499"><span class="hs-identifier hs-var">the_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868498"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868497"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="hs-comment">-- ^ 'mkSmallTupleSelector1' is like 'mkSmallTupleSelector'</span><span>
</span><span id="line-522"></span><span class="hs-comment">-- but one-tuples are NOT flattened (see Note [Flattening one-tuples])</span><span>
</span><span id="line-523"></span><span id="mkSmallTupleSelector1"><span class="annot"><span class="annottext">mkSmallTupleSelector1 :: [Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleSelector1"><span class="hs-identifier hs-var hs-var">mkSmallTupleSelector1</span></a></span></span><span> </span><span id="local-6989586621680868496"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868496"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868495"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868495"><span class="hs-identifier hs-var">the_var</span></a></span></span><span> </span><span id="local-6989586621680868494"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868494"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868493"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868493"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-524"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">notNull</span><span> </span><span class="hs-identifier">vars</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-525"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868493"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868494"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868495"><span class="hs-identifier hs-var">the_var</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-526"></span><span>         </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868496"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868496"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868495"><span class="hs-identifier hs-var">the_var</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-527"></span><span>
</span><span id="line-528"></span><span class="hs-comment">-- | A generalization of 'mkTupleSelector', allowing the body</span><span>
</span><span id="line-529"></span><span class="hs-comment">-- of the case to be an arbitrary expression.</span><span>
</span><span id="line-530"></span><span class="hs-comment">--</span><span>
</span><span id="line-531"></span><span class="hs-comment">-- To avoid shadowing, we use uniques to invent new variables.</span><span>
</span><span id="line-532"></span><span class="hs-comment">--</span><span>
</span><span id="line-533"></span><span class="hs-comment">-- If necessary we pattern match on a \&quot;big\&quot; tuple.</span><span>
</span><span id="line-534"></span><span class="annot"><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-type">mkTupleCase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span>       </span><span class="hs-comment">-- ^ For inventing names of intermediate variables</span><span>
</span><span id="line-535"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>             </span><span class="hs-comment">-- ^ The tuple identifiers to pattern match on</span><span>
</span><span id="line-536"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- ^ Body of the case</span><span>
</span><span id="line-537"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>               </span><span class="hs-comment">-- ^ A variable of the same type as the scrutinee</span><span>
</span><span id="line-538"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- ^ Scrutinee</span><span>
</span><span id="line-539"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- ToDo: eliminate cases where none of the variables are needed.</span><span>
</span><span id="line-541"></span><span class="hs-comment">--</span><span>
</span><span id="line-542"></span><span class="hs-comment">--         mkTupleCase uniqs [a,b,c,d] body v e</span><span>
</span><span id="line-543"></span><span class="hs-comment">--           = case e of v { (p,q) -&gt;</span><span>
</span><span id="line-544"></span><span class="hs-comment">--             case p of p { (a,b) -&gt;</span><span>
</span><span id="line-545"></span><span class="hs-comment">--             case q of q { (c,d) -&gt;</span><span>
</span><span id="line-546"></span><span class="hs-comment">--             body }}}</span><span>
</span><span id="line-547"></span><span id="mkTupleCase"><span class="annot"><span class="annottext">mkTupleCase :: UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var hs-var">mkTupleCase</span></a></span></span><span> </span><span id="local-6989586621680868491"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868491"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span id="local-6989586621680868490"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868490"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868489"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868489"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621680868488"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868488"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868487"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868487"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-548"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [[Id]] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621680868486"><span class="hs-identifier hs-var">mk_tuple_case</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868491"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [[Id]]
forall a. [a] -&gt; [[a]]
</span><a href="GHC.Hs.Utils.html#chunkify"><span class="hs-identifier hs-var">chunkify</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868490"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868489"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-549"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-550"></span><span>    </span><span class="hs-comment">-- This is the case where don't need any nesting</span><span>
</span><span id="line-551"></span><span>    </span><span id="local-6989586621680868486"><span class="annot"><span class="annottext">mk_tuple_case :: UniqSupply -&gt; [[Id]] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621680868486"><span class="hs-identifier hs-var hs-var">mk_tuple_case</span></a></span></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868485"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868485"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621680868484"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868484"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-552"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier hs-var">mkSmallTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868485"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868484"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868488"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868487"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span>    </span><span class="hs-comment">-- This is the case where we must make nest tuples at least once</span><span>
</span><span id="line-555"></span><span>    </span><span class="annot"><a href="#local-6989586621680868486"><span class="hs-identifier hs-var">mk_tuple_case</span></a></span><span> </span><span id="local-6989586621680868483"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868483"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621680868482"><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621680868482"><span class="hs-identifier hs-var">vars_s</span></a></span></span><span> </span><span id="local-6989586621680868481"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868481"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-556"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868479"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868479"><span class="hs-identifier hs-var">us'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868478"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868478"><span class="hs-identifier hs-var">vars'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868477"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868477"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id]
 -&gt; (UniqSupply, [Id], CoreExpr) -&gt; (UniqSupply, [Id], CoreExpr))
-&gt; (UniqSupply, [Id], CoreExpr)
-&gt; [[Id]]
-&gt; (UniqSupply, [Id], CoreExpr)
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
-&gt; (UniqSupply, [Id], CoreExpr) -&gt; (UniqSupply, [Id], CoreExpr)
</span><a href="#local-6989586621680868476"><span class="hs-identifier hs-var">one_tuple_case</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868483"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868481"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[Id]]
</span><a href="#local-6989586621680868482"><span class="hs-identifier hs-var">vars_s</span></a></span><span>
</span><span id="line-557"></span><span>            </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [[Id]] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621680868486"><span class="hs-identifier hs-var">mk_tuple_case</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868479"><span class="hs-identifier hs-var">us'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [[Id]]
forall a. [a] -&gt; [[a]]
</span><a href="GHC.Hs.Utils.html#chunkify"><span class="hs-identifier hs-var">chunkify</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868478"><span class="hs-identifier hs-var">vars'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868477"><span class="hs-identifier hs-var">body'</span></a></span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span>    </span><span id="local-6989586621680868476"><span class="annot"><span class="annottext">one_tuple_case :: [Id]
-&gt; (UniqSupply, [Id], CoreExpr) -&gt; (UniqSupply, [Id], CoreExpr)
</span><a href="#local-6989586621680868476"><span class="hs-identifier hs-var hs-var">one_tuple_case</span></a></span></span><span> </span><span id="local-6989586621680868475"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868475"><span class="hs-identifier hs-var">chunk_vars</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868474"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868474"><span class="hs-identifier hs-var">us</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868473"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868473"><span class="hs-identifier hs-var">vs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868472"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868472"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680868471"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868471"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868470"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868470"><span class="hs-identifier hs-var">us'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868474"><span class="hs-identifier hs-var">us</span></a></span><span>
</span><span id="line-561"></span><span>            </span><span id="local-6989586621680868468"><span class="annot"><span class="annottext">scrut_var :: Id
</span><a href="#local-6989586621680868468"><span class="hs-identifier hs-var hs-var">scrut_var</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Unique -&gt; Type -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkSysLocal"><span class="hs-identifier hs-var">mkSysLocal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ds&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868471"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span>
</span><span id="line-562"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Type) -&gt; [Id] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868475"><span class="hs-identifier hs-var">chunk_vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-563"></span><span>            </span><span id="local-6989586621680868465"><span class="annot"><span class="annottext">body' :: CoreExpr
</span><a href="#local-6989586621680868465"><span class="hs-identifier hs-var hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier hs-var">mkSmallTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868475"><span class="hs-identifier hs-var">chunk_vars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868472"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868468"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868468"><span class="hs-identifier hs-var">scrut_var</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680868470"><span class="hs-identifier hs-var">us'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868468"><span class="hs-identifier hs-var">scrut_var</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868473"><span class="hs-identifier hs-var">vs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868465"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-565"></span><span>
</span><span id="line-566"></span><span class="hs-comment">-- | As 'mkTupleCase', but for a tuple that is small enough to be guaranteed</span><span>
</span><span id="line-567"></span><span class="hs-comment">-- not to need nesting.</span><span>
</span><span id="line-568"></span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier hs-type">mkSmallTupleCase</span></a></span><span>
</span><span id="line-569"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- ^ The tuple args</span><span>
</span><span id="line-570"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- ^ Body of the case</span><span>
</span><span id="line-571"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>           </span><span class="hs-comment">-- ^ A variable of the same type as the scrutinee</span><span>
</span><span id="line-572"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- ^ Scrutinee</span><span>
</span><span id="line-573"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-574"></span><span>
</span><span id="line-575"></span><span id="mkSmallTupleCase"><span class="annot"><span class="annottext">mkSmallTupleCase :: [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier hs-var hs-var">mkSmallTupleCase</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680868464"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868464"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621680868463"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868463"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621680868462"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868462"><span class="hs-identifier hs-var">_scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868461"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868461"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-576"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier hs-var">bindNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868464"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868461"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868463"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-577"></span><span class="annot"><a href="GHC.Core.Make.html#mkSmallTupleCase"><span class="hs-identifier hs-var">mkSmallTupleCase</span></a></span><span> </span><span id="local-6989586621680868460"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868460"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680868459"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868459"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621680868458"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868458"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621680868457"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868457"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>
</span><span id="line-578"></span><span class="hs-comment">-- One branch no refinement?</span><span>
</span><span id="line-579"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [CoreAlt] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868457"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868458"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868459"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-580"></span><span>         </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868460"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868460"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868459"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-581"></span><span>
</span><span id="line-582"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Floats
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-589"></span><span>
</span><span id="line-590"></span><span class="hs-keyword">data</span><span> </span><span id="FloatBind"><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-var">FloatBind</span></a></span></span><span>
</span><span id="line-591"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="FloatLet"><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span></span><span>  </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span>
</span><span id="line-592"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FloatCase"><span class="annot"><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#AltCon"><span class="hs-identifier hs-type">AltCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-593"></span><span>      </span><span class="hs-comment">-- case e of y { C ys -&gt; ... }</span><span>
</span><span id="line-594"></span><span>      </span><span class="hs-comment">-- See Note [Floating single-alternative cases] in GHC.Core.Opt.SetLevels</span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680868452"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-597"></span><span>  </span><span id="local-6989586621680868442"><span class="annot"><span class="annottext">ppr :: FloatBind -&gt; SDoc
</span><a href="#local-6989586621680868442"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621680868441"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868441"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LET&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868441"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-598"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621680868438"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868438"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680868437"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868437"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680868436"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680868436"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680868435"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868435"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CASE&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868438"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;of&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868437"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-599"></span><span>                                </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680868436"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868435"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-600"></span><span>
</span><span id="line-601"></span><span class="annot"><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier hs-type">wrapFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-602"></span><span id="wrapFloat"><span class="annot"><span class="annottext">wrapFloat :: FloatBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier hs-var hs-var">wrapFloat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621680868431"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868431"><span class="hs-identifier hs-var">defns</span></a></span></span><span class="hs-special">)</span><span>       </span><span id="local-6989586621680868430"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868430"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868431"><span class="hs-identifier hs-var">defns</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868430"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-603"></span><span class="annot"><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier hs-var">wrapFloat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621680868429"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868429"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680868428"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868428"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680868427"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680868427"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680868426"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868426"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680868425"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868425"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#mkSingleAltCase"><span class="hs-identifier hs-var">mkSingleAltCase</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868429"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868428"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680868427"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868426"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868425"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span class="hs-comment">-- | Applies the floats from right to left. That is @wrapFloats [b1, b2, &#8230;, bn]</span><span>
</span><span id="line-606"></span><span class="hs-comment">-- u = let b1 in let b2 in &#8230; in let bn in u@</span><span>
</span><span id="line-607"></span><span class="annot"><a href="GHC.Core.Make.html#wrapFloats"><span class="hs-identifier hs-type">wrapFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-608"></span><span id="wrapFloats"><span class="annot"><span class="annottext">wrapFloats :: [FloatBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#wrapFloats"><span class="hs-identifier hs-var hs-var">wrapFloats</span></a></span></span><span> </span><span id="local-6989586621680868424"><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680868424"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621680868423"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868423"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatBind -&gt; CoreExpr -&gt; CoreExpr)
-&gt; CoreExpr -&gt; [FloatBind] -&gt; CoreExpr
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier hs-var">wrapFloat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868423"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680868424"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span class="annot"><a href="GHC.Core.Make.html#bindBindings"><span class="hs-identifier hs-type">bindBindings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-611"></span><span id="bindBindings"><span class="annot"><span class="annottext">bindBindings :: CoreBind -&gt; [Id]
</span><a href="GHC.Core.Make.html#bindBindings"><span class="hs-identifier hs-var hs-var">bindBindings</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680868421"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868421"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868421"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-612"></span><span class="annot"><a href="GHC.Core.Make.html#bindBindings"><span class="hs-identifier hs-var">bindBindings</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680868419"><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621680868419"><span class="hs-identifier hs-var">bnds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Id, CoreExpr) -&gt; Id) -&gt; [(Id, CoreExpr)] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621680868419"><span class="hs-identifier hs-var">bnds</span></a></span><span>
</span><span id="line-613"></span><span>
</span><span id="line-614"></span><span class="annot"><a href="GHC.Core.Make.html#floatBindings"><span class="hs-identifier hs-type">floatBindings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-615"></span><span id="floatBindings"><span class="annot"><span class="annottext">floatBindings :: FloatBind -&gt; [Id]
</span><a href="GHC.Core.Make.html#floatBindings"><span class="hs-identifier hs-var hs-var">floatBindings</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621680868418"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868418"><span class="hs-identifier hs-var">bnd</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; [Id]
</span><a href="GHC.Core.Make.html#bindBindings"><span class="hs-identifier hs-var">bindBindings</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680868418"><span class="hs-identifier hs-var">bnd</span></a></span><span>
</span><span id="line-616"></span><span class="annot"><a href="GHC.Core.Make.html#floatBindings"><span class="hs-identifier hs-var">floatBindings</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680868417"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868417"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680868416"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868416"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868417"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680868416"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Common list manipulation expressions}
*                                                                      *
************************************************************************

Call the constructor Ids when building explicit lists, so that they
interact well with rules.
-}</span><span>
</span><span id="line-628"></span><span>
</span><span id="line-629"></span><span class="hs-comment">-- | Makes a list @[]@ for lists of the specified type</span><span>
</span><span id="line-630"></span><span class="annot"><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-type">mkNilExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-631"></span><span id="mkNilExpr"><span class="annot"><span class="annottext">mkNilExpr :: Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var hs-var">mkNilExpr</span></a></span></span><span> </span><span id="local-6989586621680868415"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868415"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#nilDataCon"><span class="hs-identifier hs-var">nilDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868415"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-632"></span><span>
</span><span id="line-633"></span><span class="hs-comment">-- | Makes a list @(:)@ for lists of the specified type</span><span>
</span><span id="line-634"></span><span class="annot"><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-type">mkConsExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-635"></span><span id="mkConsExpr"><span class="annot"><span class="annottext">mkConsExpr :: Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-var hs-var">mkConsExpr</span></a></span></span><span> </span><span id="local-6989586621680868413"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868413"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680868412"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868412"><span class="hs-identifier hs-var">hd</span></a></span></span><span> </span><span id="local-6989586621680868411"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868411"><span class="hs-identifier hs-var">tl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#consDataCon"><span class="hs-identifier hs-var">consDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868413"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868412"><span class="hs-identifier hs-var">hd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868411"><span class="hs-identifier hs-var">tl</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-636"></span><span>
</span><span id="line-637"></span><span class="hs-comment">-- | Make a list containing the given expressions, where the list has the given type</span><span>
</span><span id="line-638"></span><span class="annot"><a href="GHC.Core.Make.html#mkListExpr"><span class="hs-identifier hs-type">mkListExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-639"></span><span id="mkListExpr"><span class="annot"><span class="annottext">mkListExpr :: Type -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkListExpr"><span class="hs-identifier hs-var hs-var">mkListExpr</span></a></span></span><span> </span><span id="local-6989586621680868409"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868409"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680868408"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868408"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr -&gt; CoreExpr)
-&gt; CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkConsExpr"><span class="hs-identifier hs-var">mkConsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868409"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNilExpr"><span class="hs-identifier hs-var">mkNilExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868409"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680868408"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="hs-comment">-- | Make a fully applied 'foldr' expression</span><span>
</span><span id="line-642"></span><span id="local-6989586621680868866"><span class="annot"><a href="GHC.Core.Make.html#mkFoldrExpr"><span class="hs-identifier hs-type">mkFoldrExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#MonadThings"><span class="hs-identifier hs-type">MonadThings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868866"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-643"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>             </span><span class="hs-comment">-- ^ Element type of the list</span><span>
</span><span id="line-644"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>             </span><span class="hs-comment">-- ^ Fold result type</span><span>
</span><span id="line-645"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- ^ &quot;Cons&quot; function expression for the fold</span><span>
</span><span id="line-646"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- ^ &quot;Nil&quot; expression for the fold</span><span>
</span><span id="line-647"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>         </span><span class="hs-comment">-- ^ List expression being folded acress</span><span>
</span><span id="line-648"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868866"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span></span><span>
</span><span id="line-649"></span><span id="mkFoldrExpr"><span class="annot"><span class="annottext">mkFoldrExpr :: forall (m :: * -&gt; *).
MonadThings m =&gt;
Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkFoldrExpr"><span class="hs-identifier hs-var hs-var">mkFoldrExpr</span></a></span></span><span> </span><span id="local-6989586621680868402"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868402"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621680868401"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868401"><span class="hs-identifier hs-var">result_ty</span></a></span></span><span> </span><span id="local-6989586621680868400"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868400"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680868399"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868399"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680868398"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868398"><span class="hs-identifier hs-var">list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-650"></span><span>    </span><span id="local-6989586621680868397"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868397"><span class="hs-identifier hs-var">foldr_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; m Id
forall (m :: * -&gt; *). MonadThings m =&gt; Name -&gt; m Id
</span><a href="GHC.Driver.Types.html#lookupId"><span class="hs-identifier hs-var">lookupId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#foldrName"><span class="hs-identifier hs-var">foldrName</span></a></span><span>
</span><span id="line-651"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; m CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868397"><span class="hs-identifier hs-var">foldr_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868402"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-652"></span><span>           </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868401"><span class="hs-identifier hs-var">result_ty</span></a></span><span>
</span><span id="line-653"></span><span>           </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868400"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-654"></span><span>           </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868399"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-655"></span><span>           </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868398"><span class="hs-identifier hs-var">list</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-656"></span><span>
</span><span id="line-657"></span><span class="hs-comment">-- | Make a 'build' expression applied to a locally-bound worker function</span><span>
</span><span id="line-658"></span><span id="local-6989586621680868864"><span class="annot"><a href="GHC.Core.Make.html#mkBuildExpr"><span class="hs-identifier hs-type">mkBuildExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">MonadFail</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868864"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#MonadThings"><span class="hs-identifier hs-type">MonadThings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868864"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#MonadUnique"><span class="hs-identifier hs-type">MonadUnique</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680868864"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                                     </span><span class="hs-comment">-- ^ Type of list elements to be built</span><span>
</span><span id="line-660"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868864"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Function that, given information about the 'Id's</span><span>
</span><span id="line-661"></span><span>                                                        </span><span class="hs-comment">-- of the binders for the build worker function, returns</span><span>
</span><span id="line-662"></span><span>                                                        </span><span class="hs-comment">-- the body of that worker</span><span>
</span><span id="line-663"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680868864"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span></span><span>
</span><span id="line-664"></span><span id="mkBuildExpr"><span class="annot"><span class="annottext">mkBuildExpr :: forall (m :: * -&gt; *).
(MonadFail m, MonadThings m, MonadUnique m) =&gt;
Type -&gt; ((Id, Type) -&gt; (Id, Type) -&gt; m CoreExpr) -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkBuildExpr"><span class="hs-identifier hs-var hs-var">mkBuildExpr</span></a></span></span><span> </span><span id="local-6989586621680868377"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868377"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621680868376"><span class="annot"><span class="annottext">(Id, Type) -&gt; (Id, Type) -&gt; m CoreExpr
</span><a href="#local-6989586621680868376"><span class="hs-identifier hs-var">mk_build_inside</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-665"></span><span>    </span><span id="local-6989586621680868375"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868375"><span class="hs-identifier hs-var">n_tyvar</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; m Id
forall {m :: * -&gt; *}. MonadUnique m =&gt; Id -&gt; m Id
</span><a href="#local-6989586621680868374"><span class="hs-identifier hs-var">newTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span>
</span><span id="line-666"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680868372"><span class="annot"><span class="annottext">n_ty :: Type
</span><a href="#local-6989586621680868372"><span class="hs-identifier hs-var hs-var">n_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868375"><span class="hs-identifier hs-var">n_tyvar</span></a></span><span>
</span><span id="line-667"></span><span>        </span><span id="local-6989586621680868370"><span class="annot"><span class="annottext">c_ty :: Type
</span><a href="#local-6989586621680868370"><span class="hs-identifier hs-var hs-var">c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868377"><span class="hs-identifier hs-var">elt_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868372"><span class="hs-identifier hs-var">n_ty</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868372"><span class="hs-identifier hs-var">n_ty</span></a></span><span>
</span><span id="line-668"></span><span>    </span><span class="hs-special">[</span><span id="local-6989586621680868368"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868368"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680868367"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868367"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[m Id] -&gt; m [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; Type -&gt; m Id
forall (m :: * -&gt; *).
MonadUnique m =&gt;
FastString -&gt; Type -&gt; Type -&gt; m Id
</span><a href="GHC.Types.Id.html#mkSysLocalM"><span class="hs-identifier hs-var">mkSysLocalM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;c&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868370"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; Type -&gt; m Id
forall (m :: * -&gt; *).
MonadUnique m =&gt;
FastString -&gt; Type -&gt; Type -&gt; m Id
</span><a href="GHC.Types.Id.html#mkSysLocalM"><span class="hs-identifier hs-var">mkSysLocalM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;n&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868372"><span class="hs-identifier hs-var">n_ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-669"></span><span>
</span><span id="line-670"></span><span>    </span><span id="local-6989586621680868364"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868364"><span class="hs-identifier hs-var">build_inside</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id, Type) -&gt; (Id, Type) -&gt; m CoreExpr
</span><a href="#local-6989586621680868376"><span class="hs-identifier hs-var">mk_build_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868368"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868370"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868367"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868372"><span class="hs-identifier hs-var">n_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span>    </span><span id="local-6989586621680868363"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868363"><span class="hs-identifier hs-var">build_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; m Id
forall (m :: * -&gt; *). MonadThings m =&gt; Name -&gt; m Id
</span><a href="GHC.Driver.Types.html#lookupId"><span class="hs-identifier hs-var">lookupId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#buildName"><span class="hs-identifier hs-var">buildName</span></a></span><span>
</span><span id="line-673"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; m CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; m CoreExpr) -&gt; CoreExpr -&gt; m CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868363"><span class="hs-identifier hs-var">build_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868377"><span class="hs-identifier hs-var">elt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868375"><span class="hs-identifier hs-var">n_tyvar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868368"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868367"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868364"><span class="hs-identifier hs-var">build_inside</span></a></span><span>
</span><span id="line-674"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-675"></span><span>    </span><span id="local-6989586621680868374"><span class="annot"><span class="annottext">newTyVar :: Id -&gt; m Id
</span><a href="#local-6989586621680868374"><span class="hs-identifier hs-var hs-var">newTyVar</span></a></span></span><span> </span><span id="local-6989586621680868355"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868355"><span class="hs-identifier hs-var">tyvar_tmpl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-676"></span><span>      </span><span id="local-6989586621680868354"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868354"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-677"></span><span>      </span><span class="annot"><span class="annottext">Id -&gt; m Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Id
</span><a href="GHC.Types.Var.html#setTyVarUnique"><span class="hs-identifier hs-var">setTyVarUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868355"><span class="hs-identifier hs-var">tyvar_tmpl</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868354"><span class="hs-identifier hs-var">uniq</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-678"></span><span>
</span><span id="line-679"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
             Manipulating Maybe data type
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-686"></span><span>
</span><span id="line-687"></span><span>
</span><span id="line-688"></span><span class="hs-comment">-- | Makes a Nothing for the specified type</span><span>
</span><span id="line-689"></span><span class="annot"><a href="GHC.Core.Make.html#mkNothingExpr"><span class="hs-identifier hs-type">mkNothingExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-690"></span><span id="mkNothingExpr"><span class="annot"><span class="annottext">mkNothingExpr :: Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkNothingExpr"><span class="hs-identifier hs-var hs-var">mkNothingExpr</span></a></span></span><span> </span><span id="local-6989586621680868352"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868352"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#nothingDataCon"><span class="hs-identifier hs-var">nothingDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868352"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-691"></span><span>
</span><span id="line-692"></span><span class="hs-comment">-- | Makes a Just from a value of the specified type</span><span>
</span><span id="line-693"></span><span class="annot"><a href="GHC.Core.Make.html#mkJustExpr"><span class="hs-identifier hs-type">mkJustExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-694"></span><span id="mkJustExpr"><span class="annot"><span class="annottext">mkJustExpr :: Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkJustExpr"><span class="hs-identifier hs-var hs-var">mkJustExpr</span></a></span></span><span> </span><span id="local-6989586621680868349"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868349"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680868348"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868348"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#justDataCon"><span class="hs-identifier hs-var">justDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868349"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680868348"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span>
</span><span id="line-697"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                      Error expressions
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-704"></span><span>
</span><span id="line-705"></span><span class="annot"><a href="GHC.Core.Make.html#mkRuntimeErrorApp"><span class="hs-identifier hs-type">mkRuntimeErrorApp</span></a></span><span>
</span><span id="line-706"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>           </span><span class="hs-comment">-- Should be of type (forall a. Addr# -&gt; a)</span><span>
</span><span id="line-707"></span><span>                        </span><span class="hs-comment">--      where Addr# points to a UTF8 encoded string</span><span>
</span><span id="line-708"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>         </span><span class="hs-comment">-- The type to instantiate 'a'</span><span>
</span><span id="line-709"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>       </span><span class="hs-comment">-- The string to print</span><span>
</span><span id="line-710"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-711"></span><span>
</span><span id="line-712"></span><span id="mkRuntimeErrorApp"><span class="annot"><span class="annottext">mkRuntimeErrorApp :: Id -&gt; Type -&gt; String -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkRuntimeErrorApp"><span class="hs-identifier hs-var hs-var">mkRuntimeErrorApp</span></a></span></span><span> </span><span id="local-6989586621680868346"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868346"><span class="hs-identifier hs-var">err_id</span></a></span></span><span> </span><span id="local-6989586621680868345"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868345"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621680868344"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868344"><span class="hs-identifier hs-var">err_msg</span></a></span></span><span>
</span><span id="line-713"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868346"><span class="hs-identifier hs-var">err_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868345"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-714"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868345"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
forall {b}. Expr b
</span><a href="#local-6989586621680868342"><span class="hs-identifier hs-var">err_string</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-715"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-716"></span><span>    </span><span id="local-6989586621680868342"><span class="annot"><span class="annottext">err_string :: Expr b
</span><a href="#local-6989586621680868342"><span class="hs-identifier hs-var hs-var">err_string</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Expr b
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitString"><span class="hs-identifier hs-var">mkLitString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868344"><span class="hs-identifier hs-var">err_msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-717"></span><span>
</span><span id="line-718"></span><span class="annot"><a href="GHC.Core.Make.html#mkImpossibleExpr"><span class="hs-identifier hs-type">mkImpossibleExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-719"></span><span id="mkImpossibleExpr"><span class="annot"><span class="annottext">mkImpossibleExpr :: Type -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkImpossibleExpr"><span class="hs-identifier hs-var hs-var">mkImpossibleExpr</span></a></span></span><span> </span><span id="local-6989586621680868340"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868340"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-720"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type -&gt; String -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkRuntimeErrorApp"><span class="hs-identifier hs-var">mkRuntimeErrorApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-var">rUNTIME_ERROR_ID</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868340"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Impossible case alternative&quot;</span></span><span>
</span><span id="line-721"></span><span>
</span><span id="line-722"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                     Error Ids
*                                                                      *
************************************************************************

GHC randomly injects these into the code.

@patError@ is just a version of @error@ for pattern-matching
failures.  It knows various ``codes'' which expand to longer
strings---this saves space!

@absentErr@ is a thing we put in for ``absent'' arguments.  They jolly
well shouldn't be yanked on, but if one is, then you will get a
friendly message from @absentErr@ (rather than a totally random
crash).

@parError@ is a special version of @error@ which the compiler does
not know to be a bottoming Id.  It is used in the @_par_@ and @_seq_@
templates, but we don't ever expect to generate code for it.
-}</span><span>
</span><span id="line-744"></span><span>
</span><span id="line-745"></span><span class="annot"><a href="GHC.Core.Make.html#errorIds"><span class="hs-identifier hs-type">errorIds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-746"></span><span id="errorIds"><span class="annot"><span class="annottext">errorIds :: [Id]
</span><a href="GHC.Core.Make.html#errorIds"><span class="hs-identifier hs-var hs-var">errorIds</span></a></span></span><span>
</span><span id="line-747"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-var">rUNTIME_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-748"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier hs-var">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-749"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#nO_METHOD_BINDING_ERROR_ID"><span class="hs-identifier hs-var">nO_METHOD_BINDING_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-750"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-var">pAT_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-751"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rEC_CON_ERROR_ID"><span class="hs-identifier hs-var">rEC_CON_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-752"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rEC_SEL_ERROR_ID"><span class="hs-identifier hs-var">rEC_SEL_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-753"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-754"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-755"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#tYPE_ERROR_ID"><span class="hs-identifier hs-var">tYPE_ERROR_ID</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- Used with Opt_DeferTypeErrors, see #10284</span><span>
</span><span id="line-756"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_OVERFLOW_ID"><span class="hs-identifier hs-var">rAISE_OVERFLOW_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-757"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_UNDERFLOW_ID"><span class="hs-identifier hs-var">rAISE_UNDERFLOW_ID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-758"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_DIVZERO_ID"><span class="hs-identifier hs-var">rAISE_DIVZERO_ID</span></a></span><span>
</span><span id="line-759"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-760"></span><span>
</span><span id="line-761"></span><span class="annot"><a href="GHC.Core.Make.html#recSelErrorName"><span class="hs-identifier hs-type">recSelErrorName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#runtimeErrorName"><span class="hs-identifier hs-type">runtimeErrorName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#absentErrorName"><span class="hs-identifier hs-type">absentErrorName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-762"></span><span class="annot"><a href="GHC.Core.Make.html#recConErrorName"><span class="hs-identifier hs-type">recConErrorName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#patErrorName"><span class="hs-identifier hs-type">patErrorName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-763"></span><span class="annot"><a href="GHC.Core.Make.html#nonExhaustiveGuardsErrorName"><span class="hs-identifier hs-type">nonExhaustiveGuardsErrorName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#noMethodBindingErrorName"><span class="hs-identifier hs-type">noMethodBindingErrorName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-764"></span><span class="annot"><a href="GHC.Core.Make.html#typeErrorName"><span class="hs-identifier hs-type">typeErrorName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-765"></span><span class="annot"><a href="GHC.Core.Make.html#absentSumFieldErrorName"><span class="hs-identifier hs-type">absentSumFieldErrorName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-766"></span><span class="annot"><a href="GHC.Core.Make.html#raiseOverflowName"><span class="hs-identifier hs-type">raiseOverflowName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#raiseUnderflowName"><span class="hs-identifier hs-type">raiseUnderflowName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#raiseDivZeroName"><span class="hs-identifier hs-type">raiseDivZeroName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-767"></span><span>
</span><span id="line-768"></span><span id="recSelErrorName"><span class="annot"><span class="annottext">recSelErrorName :: Name
</span><a href="GHC.Core.Make.html#recSelErrorName"><span class="hs-identifier hs-var hs-var">recSelErrorName</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;recSelError&quot;</span></span><span>     </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#recSelErrorIdKey"><span class="hs-identifier hs-var">recSelErrorIdKey</span></a></span><span>     </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rEC_SEL_ERROR_ID"><span class="hs-identifier hs-var">rEC_SEL_ERROR_ID</span></a></span><span>
</span><span id="line-769"></span><span id="absentErrorName"><span class="annot"><span class="annottext">absentErrorName :: Name
</span><a href="GHC.Core.Make.html#absentErrorName"><span class="hs-identifier hs-var hs-var">absentErrorName</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;absentError&quot;</span></span><span>     </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#absentErrorIdKey"><span class="hs-identifier hs-var">absentErrorIdKey</span></a></span><span>     </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_ERROR_ID</span></a></span><span>
</span><span id="line-770"></span><span id="runtimeErrorName"><span class="annot"><span class="annottext">runtimeErrorName :: Name
</span><a href="GHC.Core.Make.html#runtimeErrorName"><span class="hs-identifier hs-var hs-var">runtimeErrorName</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;runtimeError&quot;</span></span><span>    </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#runtimeErrorIdKey"><span class="hs-identifier hs-var">runtimeErrorIdKey</span></a></span><span>    </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-var">rUNTIME_ERROR_ID</span></a></span><span>
</span><span id="line-771"></span><span id="recConErrorName"><span class="annot"><span class="annottext">recConErrorName :: Name
</span><a href="GHC.Core.Make.html#recConErrorName"><span class="hs-identifier hs-var hs-var">recConErrorName</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;recConError&quot;</span></span><span>     </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#recConErrorIdKey"><span class="hs-identifier hs-var">recConErrorIdKey</span></a></span><span>     </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rEC_CON_ERROR_ID"><span class="hs-identifier hs-var">rEC_CON_ERROR_ID</span></a></span><span>
</span><span id="line-772"></span><span id="patErrorName"><span class="annot"><span class="annottext">patErrorName :: Name
</span><a href="GHC.Core.Make.html#patErrorName"><span class="hs-identifier hs-var hs-var">patErrorName</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;patError&quot;</span></span><span>        </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#patErrorIdKey"><span class="hs-identifier hs-var">patErrorIdKey</span></a></span><span>        </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-var">pAT_ERROR_ID</span></a></span><span>
</span><span id="line-773"></span><span id="typeErrorName"><span class="annot"><span class="annottext">typeErrorName :: Name
</span><a href="GHC.Core.Make.html#typeErrorName"><span class="hs-identifier hs-var hs-var">typeErrorName</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;typeError&quot;</span></span><span>       </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#typeErrorIdKey"><span class="hs-identifier hs-var">typeErrorIdKey</span></a></span><span>       </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#tYPE_ERROR_ID"><span class="hs-identifier hs-var">tYPE_ERROR_ID</span></a></span><span>
</span><span id="line-774"></span><span>
</span><span id="line-775"></span><span id="noMethodBindingErrorName"><span class="annot"><span class="annottext">noMethodBindingErrorName :: Name
</span><a href="GHC.Core.Make.html#noMethodBindingErrorName"><span class="hs-identifier hs-var hs-var">noMethodBindingErrorName</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;noMethodBindingError&quot;</span></span><span>
</span><span id="line-776"></span><span>                                  </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#noMethodBindingErrorIdKey"><span class="hs-identifier hs-var">noMethodBindingErrorIdKey</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#nO_METHOD_BINDING_ERROR_ID"><span class="hs-identifier hs-var">nO_METHOD_BINDING_ERROR_ID</span></a></span><span>
</span><span id="line-777"></span><span id="nonExhaustiveGuardsErrorName"><span class="annot"><span class="annottext">nonExhaustiveGuardsErrorName :: Name
</span><a href="GHC.Core.Make.html#nonExhaustiveGuardsErrorName"><span class="hs-identifier hs-var hs-var">nonExhaustiveGuardsErrorName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var">err_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;nonExhaustiveGuardsError&quot;</span></span><span>
</span><span id="line-778"></span><span>                                  </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#nonExhaustiveGuardsErrorIdKey"><span class="hs-identifier hs-var">nonExhaustiveGuardsErrorIdKey</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier hs-var">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span class="annot"><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-type">err_nm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-781"></span><span id="err_nm"><span class="annot"><span class="annottext">err_nm :: String -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Core.Make.html#err_nm"><span class="hs-identifier hs-var hs-var">err_nm</span></a></span></span><span> </span><span id="local-6989586621680868315"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868315"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621680868314"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868314"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span id="local-6989586621680868313"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868313"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FastString -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Builtin.Types.html#mkWiredInIdName"><span class="hs-identifier hs-var">mkWiredInIdName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#cONTROL_EXCEPTION_BASE"><span class="hs-identifier hs-var">cONTROL_EXCEPTION_BASE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868315"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680868314"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680868313"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span class="annot"><a href="GHC.Core.Make.html#rEC_SEL_ERROR_ID"><span class="hs-identifier hs-type">rEC_SEL_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-type">rUNTIME_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rEC_CON_ERROR_ID"><span class="hs-identifier hs-type">rEC_CON_ERROR_ID</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-784"></span><span class="annot"><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-type">pAT_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#nO_METHOD_BINDING_ERROR_ID"><span class="hs-identifier hs-type">nO_METHOD_BINDING_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier hs-type">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-785"></span><span class="annot"><a href="GHC.Core.Make.html#tYPE_ERROR_ID"><span class="hs-identifier hs-type">tYPE_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier hs-type">aBSENT_ERROR_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-type">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-786"></span><span class="annot"><a href="GHC.Core.Make.html#rAISE_OVERFLOW_ID"><span class="hs-identifier hs-type">rAISE_OVERFLOW_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rAISE_UNDERFLOW_ID"><span class="hs-identifier hs-type">rAISE_UNDERFLOW_ID</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#rAISE_DIVZERO_ID"><span class="hs-identifier hs-type">rAISE_DIVZERO_ID</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-787"></span><span id="rEC_SEL_ERROR_ID"><span class="annot"><span class="annottext">rEC_SEL_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#rEC_SEL_ERROR_ID"><span class="hs-identifier hs-var hs-var">rEC_SEL_ERROR_ID</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#recSelErrorName"><span class="hs-identifier hs-var">recSelErrorName</span></a></span><span>
</span><span id="line-788"></span><span id="rUNTIME_ERROR_ID"><span class="annot"><span class="annottext">rUNTIME_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-var hs-var">rUNTIME_ERROR_ID</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#runtimeErrorName"><span class="hs-identifier hs-var">runtimeErrorName</span></a></span><span>
</span><span id="line-789"></span><span id="rEC_CON_ERROR_ID"><span class="annot"><span class="annottext">rEC_CON_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#rEC_CON_ERROR_ID"><span class="hs-identifier hs-var hs-var">rEC_CON_ERROR_ID</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#recConErrorName"><span class="hs-identifier hs-var">recConErrorName</span></a></span><span>
</span><span id="line-790"></span><span id="pAT_ERROR_ID"><span class="annot"><span class="annottext">pAT_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-var hs-var">pAT_ERROR_ID</span></a></span></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#patErrorName"><span class="hs-identifier hs-var">patErrorName</span></a></span><span>
</span><span id="line-791"></span><span id="nO_METHOD_BINDING_ERROR_ID"><span class="annot"><span class="annottext">nO_METHOD_BINDING_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#nO_METHOD_BINDING_ERROR_ID"><span class="hs-identifier hs-var hs-var">nO_METHOD_BINDING_ERROR_ID</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#noMethodBindingErrorName"><span class="hs-identifier hs-var">noMethodBindingErrorName</span></a></span><span>
</span><span id="line-792"></span><span id="nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="annot"><span class="annottext">nON_EXHAUSTIVE_GUARDS_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier hs-var hs-var">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#nonExhaustiveGuardsErrorName"><span class="hs-identifier hs-var">nonExhaustiveGuardsErrorName</span></a></span><span>
</span><span id="line-793"></span><span id="tYPE_ERROR_ID"><span class="annot"><span class="annottext">tYPE_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#tYPE_ERROR_ID"><span class="hs-identifier hs-var hs-var">tYPE_ERROR_ID</span></a></span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var">mkRuntimeErrorId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#typeErrorName"><span class="hs-identifier hs-var">typeErrorName</span></a></span><span>
</span><span id="line-794"></span><span>
</span><span id="line-795"></span><span class="hs-comment">-- Note [aBSENT_SUM_FIELD_ERROR_ID]</span><span>
</span><span id="line-796"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-797"></span><span class="hs-comment">--</span><span>
</span><span id="line-798"></span><span class="hs-comment">-- Unboxed sums are transformed into unboxed tuples in GHC.Stg.Unarise.mkUbxSum</span><span>
</span><span id="line-799"></span><span class="hs-comment">-- and fields that can't be reached are filled with rubbish values. It's easy to</span><span>
</span><span id="line-800"></span><span class="hs-comment">-- come up with rubbish literal values: we use 0 (ints/words) and 0.0</span><span>
</span><span id="line-801"></span><span class="hs-comment">-- (floats/doubles). Coming up with a rubbish pointer value is more delicate:</span><span>
</span><span id="line-802"></span><span class="hs-comment">--</span><span>
</span><span id="line-803"></span><span class="hs-comment">--    1. it needs to be a valid closure pointer for the GC (not a NULL pointer)</span><span>
</span><span id="line-804"></span><span class="hs-comment">--</span><span>
</span><span id="line-805"></span><span class="hs-comment">--    2. it is never used in Core, only in STG; and even then only for filling a</span><span>
</span><span id="line-806"></span><span class="hs-comment">--       GC-ptr slot in an unboxed sum (see GHC.Stg.Unarise.ubxSumRubbishArg).</span><span>
</span><span id="line-807"></span><span class="hs-comment">--       So all we need is a pointer, and its levity doesn't matter. Hence we</span><span>
</span><span id="line-808"></span><span class="hs-comment">--       can safely give it the (lifted) type:</span><span>
</span><span id="line-809"></span><span class="hs-comment">--</span><span>
</span><span id="line-810"></span><span class="hs-comment">--             absentSumFieldError :: forall a. a</span><span>
</span><span id="line-811"></span><span class="hs-comment">--</span><span>
</span><span id="line-812"></span><span class="hs-comment">--       despite the fact that Unarise might instantiate it at non-lifted</span><span>
</span><span id="line-813"></span><span class="hs-comment">--       types.</span><span>
</span><span id="line-814"></span><span class="hs-comment">--</span><span>
</span><span id="line-815"></span><span class="hs-comment">--    3. it can't take arguments because it's used in unarise and applying an</span><span>
</span><span id="line-816"></span><span class="hs-comment">--       argument would require allocating a thunk.</span><span>
</span><span id="line-817"></span><span class="hs-comment">--</span><span>
</span><span id="line-818"></span><span class="hs-comment">--    4. it can't be CAFFY because that would mean making some non-CAFFY</span><span>
</span><span id="line-819"></span><span class="hs-comment">--       definitions that use unboxed sums CAFFY in unarise.</span><span>
</span><span id="line-820"></span><span class="hs-comment">--</span><span>
</span><span id="line-821"></span><span class="hs-comment">--       Getting this wrong causes hard-to-debug runtime issues, see #15038.</span><span>
</span><span id="line-822"></span><span class="hs-comment">--</span><span>
</span><span id="line-823"></span><span class="hs-comment">--    5. it can't be defined in `base` package.</span><span>
</span><span id="line-824"></span><span class="hs-comment">--</span><span>
</span><span id="line-825"></span><span class="hs-comment">--       Defining `absentSumFieldError` in `base` package introduces a</span><span>
</span><span id="line-826"></span><span class="hs-comment">--       dependency on `base` for any code using unboxed sums. It became an</span><span>
</span><span id="line-827"></span><span class="hs-comment">--       issue when we wanted to use unboxed sums in boot libraries used by</span><span>
</span><span id="line-828"></span><span class="hs-comment">--       `base`, see #17791.</span><span>
</span><span id="line-829"></span><span class="hs-comment">--</span><span>
</span><span id="line-830"></span><span class="hs-comment">--</span><span>
</span><span id="line-831"></span><span class="hs-comment">-- * Most runtime-error functions throw a proper Haskell exception, which can be</span><span>
</span><span id="line-832"></span><span class="hs-comment">--   caught in the usual way. But these functions are defined in</span><span>
</span><span id="line-833"></span><span class="hs-comment">--   `base:Control.Exception.Base`, hence, they cannot be directly invoked in</span><span>
</span><span id="line-834"></span><span class="hs-comment">--   any library compiled before `base`.  Only exceptions that have been wired</span><span>
</span><span id="line-835"></span><span class="hs-comment">--   in the RTS can be thrown (indirectly, via a call into the RTS) by libraries</span><span>
</span><span id="line-836"></span><span class="hs-comment">--   compiled before `base`.</span><span>
</span><span id="line-837"></span><span class="hs-comment">--</span><span>
</span><span id="line-838"></span><span class="hs-comment">--   However wiring exceptions in the RTS is a bit annoying because we need to</span><span>
</span><span id="line-839"></span><span class="hs-comment">--   explicitly import exception closures via their mangled symbol name (e.g.</span><span>
</span><span id="line-840"></span><span class="hs-comment">--   `import CLOSURE base_GHCziIOziException_heapOverflow_closure`) in Cmm files</span><span>
</span><span id="line-841"></span><span class="hs-comment">--   and every imported symbol must be indicated to the linker in a few files</span><span>
</span><span id="line-842"></span><span class="hs-comment">--   (`package.conf`, `rts.cabal`, `win32/libHSbase.def`, `Prelude.h`...). It</span><span>
</span><span id="line-843"></span><span class="hs-comment">--   explains why exceptions are only wired in the RTS when necessary.</span><span>
</span><span id="line-844"></span><span class="hs-comment">--</span><span>
</span><span id="line-845"></span><span class="hs-comment">-- * `absentSumFieldError` is defined in ghc-prim:GHC.Prim.Panic, hence, it can</span><span>
</span><span id="line-846"></span><span class="hs-comment">--   be invoked in libraries compiled before `base`. It does not throw a Haskell</span><span>
</span><span id="line-847"></span><span class="hs-comment">--   exception; instead, it calls `stg_panic#`, which immediately halts</span><span>
</span><span id="line-848"></span><span class="hs-comment">--   execution.  A runtime invocation of `absentSumFieldError` indicates a GHC</span><span>
</span><span id="line-849"></span><span class="hs-comment">--   bug. Unlike (say) pattern-match errors, it cannot be caused by a user</span><span>
</span><span id="line-850"></span><span class="hs-comment">--   error. That's why it is OK for it to be un-catchable.</span><span>
</span><span id="line-851"></span><span class="hs-comment">--</span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span id="absentSumFieldErrorName"><span class="annot"><span class="annottext">absentSumFieldErrorName :: Name
</span><a href="GHC.Core.Make.html#absentSumFieldErrorName"><span class="hs-identifier hs-var hs-var">absentSumFieldErrorName</span></a></span></span><span>
</span><span id="line-854"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FastString -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Builtin.Types.html#mkWiredInIdName"><span class="hs-identifier hs-var">mkWiredInIdName</span></a></span><span>
</span><span id="line-855"></span><span>      </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM_PANIC"><span class="hs-identifier hs-var">gHC_PRIM_PANIC</span></a></span><span>
</span><span id="line-856"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;absentSumFieldError&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-857"></span><span>      </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#absentSumFieldErrorIdKey"><span class="hs-identifier hs-var">absentSumFieldErrorIdKey</span></a></span><span>
</span><span id="line-858"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span>
</span><span id="line-859"></span><span>
</span><span id="line-860"></span><span id="raiseOverflowName"><span class="annot"><span class="annottext">raiseOverflowName :: Name
</span><a href="GHC.Core.Make.html#raiseOverflowName"><span class="hs-identifier hs-var hs-var">raiseOverflowName</span></a></span></span><span>
</span><span id="line-861"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FastString -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Builtin.Types.html#mkWiredInIdName"><span class="hs-identifier hs-var">mkWiredInIdName</span></a></span><span>
</span><span id="line-862"></span><span>      </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM_EXCEPTION"><span class="hs-identifier hs-var">gHC_PRIM_EXCEPTION</span></a></span><span>
</span><span id="line-863"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;raiseOverflow&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-864"></span><span>      </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#raiseOverflowIdKey"><span class="hs-identifier hs-var">raiseOverflowIdKey</span></a></span><span>
</span><span id="line-865"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_OVERFLOW_ID"><span class="hs-identifier hs-var">rAISE_OVERFLOW_ID</span></a></span><span>
</span><span id="line-866"></span><span>
</span><span id="line-867"></span><span id="raiseUnderflowName"><span class="annot"><span class="annottext">raiseUnderflowName :: Name
</span><a href="GHC.Core.Make.html#raiseUnderflowName"><span class="hs-identifier hs-var hs-var">raiseUnderflowName</span></a></span></span><span>
</span><span id="line-868"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FastString -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Builtin.Types.html#mkWiredInIdName"><span class="hs-identifier hs-var">mkWiredInIdName</span></a></span><span>
</span><span id="line-869"></span><span>      </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM_EXCEPTION"><span class="hs-identifier hs-var">gHC_PRIM_EXCEPTION</span></a></span><span>
</span><span id="line-870"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;raiseUnderflow&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-871"></span><span>      </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#raiseUnderflowIdKey"><span class="hs-identifier hs-var">raiseUnderflowIdKey</span></a></span><span>
</span><span id="line-872"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_UNDERFLOW_ID"><span class="hs-identifier hs-var">rAISE_UNDERFLOW_ID</span></a></span><span>
</span><span id="line-873"></span><span>
</span><span id="line-874"></span><span id="raiseDivZeroName"><span class="annot"><span class="annottext">raiseDivZeroName :: Name
</span><a href="GHC.Core.Make.html#raiseDivZeroName"><span class="hs-identifier hs-var hs-var">raiseDivZeroName</span></a></span></span><span>
</span><span id="line-875"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FastString -&gt; Unique -&gt; Id -&gt; Name
</span><a href="GHC.Builtin.Types.html#mkWiredInIdName"><span class="hs-identifier hs-var">mkWiredInIdName</span></a></span><span>
</span><span id="line-876"></span><span>      </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM_EXCEPTION"><span class="hs-identifier hs-var">gHC_PRIM_EXCEPTION</span></a></span><span>
</span><span id="line-877"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;raiseDivZero&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-878"></span><span>      </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#raiseDivZeroIdKey"><span class="hs-identifier hs-var">raiseDivZeroIdKey</span></a></span><span>
</span><span id="line-879"></span><span>      </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rAISE_DIVZERO_ID"><span class="hs-identifier hs-var">rAISE_DIVZERO_ID</span></a></span><span>
</span><span id="line-880"></span><span>
</span><span id="line-881"></span><span id="aBSENT_SUM_FIELD_ERROR_ID"><span class="annot"><span class="annottext">aBSENT_SUM_FIELD_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-var hs-var">aBSENT_SUM_FIELD_ERROR_ID</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-var">mkExceptionId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#absentSumFieldErrorName"><span class="hs-identifier hs-var">absentSumFieldErrorName</span></a></span><span>
</span><span id="line-882"></span><span id="rAISE_OVERFLOW_ID"><span class="annot"><span class="annottext">rAISE_OVERFLOW_ID :: Id
</span><a href="GHC.Core.Make.html#rAISE_OVERFLOW_ID"><span class="hs-identifier hs-var hs-var">rAISE_OVERFLOW_ID</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-var">mkExceptionId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#raiseOverflowName"><span class="hs-identifier hs-var">raiseOverflowName</span></a></span><span>
</span><span id="line-883"></span><span id="rAISE_UNDERFLOW_ID"><span class="annot"><span class="annottext">rAISE_UNDERFLOW_ID :: Id
</span><a href="GHC.Core.Make.html#rAISE_UNDERFLOW_ID"><span class="hs-identifier hs-var hs-var">rAISE_UNDERFLOW_ID</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-var">mkExceptionId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#raiseUnderflowName"><span class="hs-identifier hs-var">raiseUnderflowName</span></a></span><span>
</span><span id="line-884"></span><span id="rAISE_DIVZERO_ID"><span class="annot"><span class="annottext">rAISE_DIVZERO_ID :: Id
</span><a href="GHC.Core.Make.html#rAISE_DIVZERO_ID"><span class="hs-identifier hs-var hs-var">rAISE_DIVZERO_ID</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-var">mkExceptionId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#raiseDivZeroName"><span class="hs-identifier hs-var">raiseDivZeroName</span></a></span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span class="hs-comment">-- | Exception with type \&quot;forall a. a\&quot;</span><span>
</span><span id="line-887"></span><span class="annot"><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-type">mkExceptionId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-888"></span><span id="mkExceptionId"><span class="annot"><span class="annottext">mkExceptionId :: Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkExceptionId"><span class="hs-identifier hs-var hs-var">mkExceptionId</span></a></span></span><span> </span><span id="local-6989586621680868302"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680868302"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-889"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; IdInfo -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobalWithInfo"><span class="hs-identifier hs-var">mkVanillaGlobalWithInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680868302"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-890"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- forall a . a</span><span>
</span><span id="line-891"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo
</span><a href="GHC.Types.Id.Info.html#vanillaIdInfo"><span class="hs-identifier hs-var">vanillaIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; StrictSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setStrictnessInfo"><span class="hs-operator hs-var">`setStrictnessInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand] -&gt; Divergence -&gt; StrictSig
</span><a href="GHC.Types.Demand.html#mkClosedStrictSig"><span class="hs-identifier hs-var">mkClosedStrictSig</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Divergence
</span><a href="GHC.Types.Demand.html#botDiv"><span class="hs-identifier hs-var">botDiv</span></a></span><span>
</span><span id="line-892"></span><span>                     </span><span class="annot"><span class="annottext">IdInfo -&gt; CprSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setCprInfo"><span class="hs-operator hs-var">`setCprInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; CprResult -&gt; CprSig
</span><a href="GHC.Types.Cpr.html#mkCprSig"><span class="hs-identifier hs-var">mkCprSig</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">CprResult
</span><a href="GHC.Types.Cpr.html#botCpr"><span class="hs-identifier hs-var">botCpr</span></a></span><span>
</span><span id="line-893"></span><span>                     </span><span class="annot"><span class="annottext">IdInfo -&gt; Int -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setArityInfo"><span class="hs-operator hs-var">`setArityInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-894"></span><span>                     </span><span class="annot"><span class="annottext">IdInfo -&gt; CafInfo -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setCafInfo"><span class="hs-operator hs-var">`setCafInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier hs-var">NoCafRefs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- #15038</span><span>
</span><span id="line-895"></span><span>
</span><span id="line-896"></span><span class="annot"><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-type">mkRuntimeErrorId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-897"></span><span class="hs-comment">-- Error function</span><span>
</span><span id="line-898"></span><span class="hs-comment">--   with type:  forall (r:RuntimeRep) (a:TYPE r). Addr# -&gt; a</span><span>
</span><span id="line-899"></span><span class="hs-comment">--   with arity: 1</span><span>
</span><span id="line-900"></span><span class="hs-comment">-- which diverges after being given one argument</span><span>
</span><span id="line-901"></span><span class="hs-comment">-- The Addr# is expected to be the address of</span><span>
</span><span id="line-902"></span><span class="hs-comment">--   a UTF8-encoded error string</span><span>
</span><span id="line-903"></span><span id="mkRuntimeErrorId"><span class="annot"><span class="annottext">mkRuntimeErrorId :: Name -&gt; Id
</span><a href="GHC.Core.Make.html#mkRuntimeErrorId"><span class="hs-identifier hs-var hs-var">mkRuntimeErrorId</span></a></span></span><span> </span><span id="local-6989586621680868289"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680868289"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-904"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; IdInfo -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobalWithInfo"><span class="hs-identifier hs-var">mkVanillaGlobalWithInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680868289"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Make.html#runtimeErrorTy"><span class="hs-identifier hs-var">runtimeErrorTy</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621680868287"><span class="hs-identifier hs-var">bottoming_info</span></a></span><span>
</span><span id="line-905"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-906"></span><span>    </span><span id="local-6989586621680868287"><span class="annot"><span class="annottext">bottoming_info :: IdInfo
</span><a href="#local-6989586621680868287"><span class="hs-identifier hs-var hs-var">bottoming_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="GHC.Types.Id.Info.html#vanillaIdInfo"><span class="hs-identifier hs-var">vanillaIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; StrictSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setStrictnessInfo"><span class="hs-operator hs-var">`setStrictnessInfo`</span></a></span><span>    </span><span class="annot"><span class="annottext">StrictSig
</span><a href="#local-6989586621680868286"><span class="hs-identifier hs-var">strict_sig</span></a></span><span>
</span><span id="line-907"></span><span>                                   </span><span class="annot"><span class="annottext">IdInfo -&gt; CprSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setCprInfo"><span class="hs-operator hs-var">`setCprInfo`</span></a></span><span>           </span><span class="annot"><span class="annottext">Int -&gt; CprResult -&gt; CprSig
</span><a href="GHC.Types.Cpr.html#mkCprSig"><span class="hs-identifier hs-var">mkCprSig</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">CprResult
</span><a href="GHC.Types.Cpr.html#botCpr"><span class="hs-identifier hs-var">botCpr</span></a></span><span>
</span><span id="line-908"></span><span>                                   </span><span class="annot"><span class="annottext">IdInfo -&gt; Int -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setArityInfo"><span class="hs-operator hs-var">`setArityInfo`</span></a></span><span>         </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-909"></span><span>                        </span><span class="hs-comment">-- Make arity and strictness agree</span><span>
</span><span id="line-910"></span><span>
</span><span id="line-911"></span><span>        </span><span class="hs-comment">-- Do *not* mark them as NoCafRefs, because they can indeed have</span><span>
</span><span id="line-912"></span><span>        </span><span class="hs-comment">-- CAF refs.  For example, pAT_ERROR_ID calls GHC.Err.untangle,</span><span>
</span><span id="line-913"></span><span>        </span><span class="hs-comment">-- which has some CAFs</span><span>
</span><span id="line-914"></span><span>        </span><span class="hs-comment">-- In due course we may arrange that these error-y things are</span><span>
</span><span id="line-915"></span><span>        </span><span class="hs-comment">-- regarded by the GC as permanently live, in which case we</span><span>
</span><span id="line-916"></span><span>        </span><span class="hs-comment">-- can give them NoCaf info.  As it is, any function that calls</span><span>
</span><span id="line-917"></span><span>        </span><span class="hs-comment">-- any pc_bottoming_Id will itself have CafRefs, which bloats</span><span>
</span><span id="line-918"></span><span>        </span><span class="hs-comment">-- SRTs.</span><span>
</span><span id="line-919"></span><span>
</span><span id="line-920"></span><span>    </span><span id="local-6989586621680868286"><span class="annot"><span class="annottext">strict_sig :: StrictSig
</span><a href="#local-6989586621680868286"><span class="hs-identifier hs-var hs-var">strict_sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Demand] -&gt; Divergence -&gt; StrictSig
</span><a href="GHC.Types.Demand.html#mkClosedStrictSig"><span class="hs-identifier hs-var">mkClosedStrictSig</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#evalDmd"><span class="hs-identifier hs-var">evalDmd</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Divergence
</span><a href="GHC.Types.Demand.html#botDiv"><span class="hs-identifier hs-var">botDiv</span></a></span><span>
</span><span id="line-921"></span><span>
</span><span id="line-922"></span><span class="annot"><a href="GHC.Core.Make.html#runtimeErrorTy"><span class="hs-identifier hs-type">runtimeErrorTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-923"></span><span class="hs-comment">-- forall (rr :: RuntimeRep) (a :: rr). Addr# -&gt; a</span><span>
</span><span id="line-924"></span><span class="hs-comment">--   See Note [Error and friends have an &quot;open-tyvar&quot; forall]</span><span>
</span><span id="line-925"></span><span id="runtimeErrorTy"><span class="annot"><span class="annottext">runtimeErrorTy :: Type
</span><a href="GHC.Core.Make.html#runtimeErrorTy"><span class="hs-identifier hs-var hs-var">runtimeErrorTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep1TyVar"><span class="hs-identifier hs-var">runtimeRep1TyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTyVar"><span class="hs-identifier hs-var">openAlphaTyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-926"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#addrPrimTy"><span class="hs-identifier hs-var">addrPrimTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTy"><span class="hs-identifier hs-var">openAlphaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-927"></span><span>
</span><span id="line-928"></span><span class="hs-comment">{- Note [Error and friends have an &quot;open-tyvar&quot; forall]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'error' and 'undefined' have types
        error     :: forall (v :: RuntimeRep) (a :: TYPE v). String -&gt; a
        undefined :: forall (v :: RuntimeRep) (a :: TYPE v). a
Notice the runtime-representation polymorphism. This ensures that
&quot;error&quot; can be instantiated at unboxed as well as boxed types.
This is OK because it never returns, so the return type is irrelevant.


************************************************************************
*                                                                      *
                     aBSENT_ERROR_ID
*                                                                      *
************************************************************************

Note [aBSENT_ERROR_ID]
~~~~~~~~~~~~~~~~~~~~~~
We use aBSENT_ERROR_ID to build dummy values in workers.  E.g.

   f x = (case x of (a,b) -&gt; b) + 1::Int

The demand analyser figures ot that only the second component of x is
used, and does a w/w split thus

   f x = case x of (a,b) -&gt; $wf b

   $wf b = let a = absentError &quot;blah&quot;
               x = (a,b)
           in &lt;the original RHS of f&gt;

After some simplification, the (absentError &quot;blah&quot;) thunk goes away.

------ Tricky wrinkle -------
#14285 had, roughly

   data T a = MkT a !a
   {-# INLINABLE f #-}
   f x = case x of MkT a b -&gt; g (MkT b a)

It turned out that g didn't use the second component, and hence f doesn't use
the first.  But the stable-unfolding for f looks like
   \x. case x of MkT a b -&gt; g ($WMkT b a)
where $WMkT is the wrapper for MkT that evaluates its arguments.  We
apply the same w/w split to this unfolding (see Note [Worker-wrapper
for INLINEABLE functions] in GHC.Core.Opt.WorkWrap) so the template ends up like
   \b. let a = absentError &quot;blah&quot;
           x = MkT a b
        in case x of MkT a b -&gt; g ($WMkT b a)

After doing case-of-known-constructor, and expanding $WMkT we get
   \b -&gt; g (case absentError &quot;blah&quot; of a -&gt; MkT b a)

Yikes!  That bogusly appears to evaluate the absentError!

This is extremely tiresome.  Another way to think of this is that, in
Core, it is an invariant that a strict data constructor, like MkT, must
be applied only to an argument in HNF. So (absentError &quot;blah&quot;) had
better be non-bottom.

So the &quot;solution&quot; is to add a special case for absentError to exprIsHNFlike.
This allows Simplify.rebuildCase, in the Note [Case to let transformation]
branch, to convert the case on absentError into a let. We also make
absentError *not* be diverging, unlike the other error-ids, so that we
can be sure not to remove the case branches before converting the case to
a let.

If, by some bug or bizarre happenstance, we ever call absentError, we should
throw an exception.  This should never happen, of course, but we definitely
can't return anything.  e.g. if somehow we had
    case absentError &quot;foo&quot; of
       Nothing -&gt; ...
       Just x  -&gt; ...
then if we return, the case expression will select a field and continue.
Seg fault city. Better to throw an exception. (Even though we've said
it is in HNF :-)

It might seem a bit surprising that seq on absentError is simply erased

    absentError &quot;foo&quot; `seq` x ==&gt; x

but that should be okay; since there's no pattern match we can't really
be relying on anything from it.
-}</span><span>
</span><span id="line-1012"></span><span>
</span><span id="line-1013"></span><span id="aBSENT_ERROR_ID"><span class="annot"><span class="annottext">aBSENT_ERROR_ID :: Id
</span><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier hs-var hs-var">aBSENT_ERROR_ID</span></a></span></span><span>
</span><span id="line-1014"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; IdInfo -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobalWithInfo"><span class="hs-identifier hs-var">mkVanillaGlobalWithInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Core.Make.html#absentErrorName"><span class="hs-identifier hs-var">absentErrorName</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868279"><span class="hs-identifier hs-var">absent_ty</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621680868278"><span class="hs-identifier hs-var">arity_info</span></a></span><span>
</span><span id="line-1015"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1016"></span><span>   </span><span id="local-6989586621680868279"><span class="annot"><span class="annottext">absent_ty :: Type
</span><a href="#local-6989586621680868279"><span class="hs-identifier hs-var hs-var">absent_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#addrPrimTy"><span class="hs-identifier hs-var">addrPrimTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1017"></span><span>   </span><span class="hs-comment">-- Not runtime-rep polymorphic. aBSENT_ERROR_ID is only used for</span><span>
</span><span id="line-1018"></span><span>   </span><span class="hs-comment">-- lifted-type things; see Note [Absent errors] in GHC.Core.Opt.WorkWrap.Utils</span><span>
</span><span id="line-1019"></span><span>   </span><span id="local-6989586621680868278"><span class="annot"><span class="annottext">arity_info :: IdInfo
</span><a href="#local-6989586621680868278"><span class="hs-identifier hs-var hs-var">arity_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="GHC.Types.Id.Info.html#vanillaIdInfo"><span class="hs-identifier hs-var">vanillaIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; Int -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setArityInfo"><span class="hs-operator hs-var">`setArityInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1020"></span><span>   </span><span class="hs-comment">-- NB: no bottoming strictness info, unlike other error-ids.</span><span>
</span><span id="line-1021"></span><span>   </span><span class="hs-comment">-- See Note [aBSENT_ERROR_ID]</span><span>
</span><span id="line-1022"></span><span>
</span><span id="line-1023"></span><span class="annot"><a href="GHC.Core.Make.html#mkAbsentErrorApp"><span class="hs-identifier hs-type">mkAbsentErrorApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>         </span><span class="hs-comment">-- The type to instantiate 'a'</span><span>
</span><span id="line-1024"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>       </span><span class="hs-comment">-- The string to print</span><span>
</span><span id="line-1025"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1026"></span><span>
</span><span id="line-1027"></span><span id="mkAbsentErrorApp"><span class="annot"><span class="annottext">mkAbsentErrorApp :: Type -&gt; String -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkAbsentErrorApp"><span class="hs-identifier hs-var hs-var">mkAbsentErrorApp</span></a></span></span><span> </span><span id="local-6989586621680868276"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868276"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621680868275"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868275"><span class="hs-identifier hs-var">err_msg</span></a></span></span><span>
</span><span id="line-1028"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_ERROR_ID</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680868276"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
forall {b}. Expr b
</span><a href="#local-6989586621680868274"><span class="hs-identifier hs-var">err_string</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1029"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1030"></span><span>    </span><span id="local-6989586621680868274"><span class="annot"><span class="annottext">err_string :: Expr b
</span><a href="#local-6989586621680868274"><span class="hs-identifier hs-var hs-var">err_string</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Expr b
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitString"><span class="hs-identifier hs-var">mkLitString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680868275"><span class="hs-identifier hs-var">err_msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1031"></span></pre></body></html>